Files
bit/db/migrations/20240513115731_create_users.sql
T
Juan Rodriguez 0ad534065c feat: user migration + model
- link belongs to user
- user api_key index
2024-05-13 22:33:38 +02:00

14 lines
419 B
SQL

-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE users (
id TEXT PRIMARY KEY NOT NULL,
name VARCHAR(100) NOT NULL,
api_key VARCHAR(64) UNIQUE NOT NULL,
created_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
);
-- +micrate Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE users;