notXCS/migrations/0002_add_users.sql

4 lines
244 B
SQL

CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, password TEXT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP);
ALTER TABLE places ADD COLUMN ownerId INTEGER REFERENCES users(id);