Debian Codegraph @

podcasts-data/migrations/2024-07-06-140607_use_timestamp_instead_of_integer/down.sql

raw
1 ALTER TABLE episodes RENAME TO old_table;
2
3 CREATE TABLE episodes (
4 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
5 title TEXT NOT NULL,
6 uri TEXT,
7 local_uri TEXT,
8 description TEXT,
9 image_uri TEXT,
10 epoch INTEGER NOT NULL DEFAULT ,
11 length INTEGER,
12 duration INTEGER,
13 guid TEXT,
14 played INTEGER,
15 play_position INTEGER NOT NULL,
16 show_id INTEGER NOT NULL
17 );
18
19 INSERT INTO episodes (id, title, uri, local_uri, description, image_uri, (cast(strftime('%s', epoch) as int)), length, duration, guid, (cast(strftime('%s', played) as int)), show_id, play_position)
20 SELECT id, title, uri, local_uri, description, image_uri, epoch, length, duration, guid, played, show_id, play_position
21 FROM old_table;
22 Drop table old_table;