diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-04 22:12:15 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-04 22:38:25 -0400 |
| commit | b422be184e01b4cc35b9c9a6921379080c24edb3 (patch) | |
| tree | b35bec7a4025e9874ba2683e3b9b8da4447c2fb0 /migrations/20240929013644_token_id.sql | |
| parent | 9bd6d9862b1c243def02200bca2cfbf578ad2a2f (diff) | |
Start fresh with database migrations.
The migration path from the original project inception to now was complicated and buggy, and stranded _both_ Kit and I with broken databases due to oversights and incomplete migrations. We've agreed to start fresh, once.
If this is mistakenly started with an original-schema-flavour DB, startup will be aborted.
Diffstat (limited to 'migrations/20240929013644_token_id.sql')
| -rw-r--r-- | migrations/20240929013644_token_id.sql | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/migrations/20240929013644_token_id.sql b/migrations/20240929013644_token_id.sql deleted file mode 100644 index ad4d8b4..0000000 --- a/migrations/20240929013644_token_id.sql +++ /dev/null @@ -1,29 +0,0 @@ -alter table token -rename to old_token; - -create table token ( - id text - not null - primary key, - secret text - not null - unique, - login text - not null, - issued_at text - not null, - last_used_at text - not null, - foreign key (login) - references login (id) -); - -insert into token -select - 'T' || lower(hex(randomblob(8))) as id, - * -from old_token; - -drop table old_token; - -create index token_issued_at on token (issued_at); |
