11
pkg/coredata/migrations/20250311T183100Z.sql
Normal file
11
pkg/coredata/migrations/20250311T183100Z.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE emails (
|
||||
id TEXT PRIMARY KEY,
|
||||
email_address_to TEXT NOT NULL,
|
||||
subject TEXT NOT NULL,
|
||||
text_body TEXT NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
sent_at TIMESTAMP WITH TIME ZONE
|
||||
);
|
||||
|
||||
CREATE INDEX ON emails (sent_at) WHERE sent_at IS NULL;
|
||||
8
pkg/coredata/migrations/20250312T084900Z.sql
Normal file
8
pkg/coredata/migrations/20250312T084900Z.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE emails ADD COLUMN recipient_name TEXT NOT NULL;
|
||||
ALTER TABLE emails RENAME COLUMN email_address_to TO recipient_email;
|
||||
|
||||
ALTER TABLE emails ALTER COLUMN created_at DROP DEFAULT;
|
||||
ALTER TABLE emails ALTER COLUMN updated_at DROP DEFAULT;
|
||||
|
||||
ALTER TABLE emails ALTER COLUMN created_at SET NOT NULL;
|
||||
ALTER TABLE emails ALTER COLUMN updated_at SET NOT NULL;
|
||||
Reference in New Issue
Block a user