-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct the SQLite schema for the exports table
- Loading branch information
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
begin; | ||
create table exports2 ( | ||
export_id integer primary key autoincrement, | ||
site_id integer not null, | ||
start_from_hit_id integer not null, | ||
|
||
path varchar not null, | ||
created_at timestamp not null check(created_at = strftime('%Y-%m-%d %H:%M:%S', created_at)), | ||
|
||
finished_at timestamp check(finished_at is null or finished_at = strftime('%Y-%m-%d %H:%M:%S', finished_at)), | ||
last_hit_id integer, | ||
num_rows integer, | ||
size varchar, | ||
hash varchar, | ||
error varchar, | ||
|
||
foreign key (site_id) references sites(id) on delete restrict on update restrict | ||
); | ||
insert into exports2 | ||
select export_id, site_id, start_from_hit_id, path, created_at, finished_at, last_hit_id, num_rows, size, hash, error from exports; | ||
drop table exports; | ||
alter table exports2 rename to exports; | ||
create index "exports#site_id#created_at" on exports(site_id, created_at); | ||
|
||
insert into version values('2020-11-10-1-correct-exports'); | ||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters