fix db migration
This commit is contained in:
parent
1527445857
commit
a7d3a63b28
|
@ -427,7 +427,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "datatrash"
|
name = "datatrash"
|
||||||
version = "1.1.5"
|
version = "1.1.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-files",
|
"actix-files",
|
||||||
"actix-governor",
|
"actix-governor",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "datatrash"
|
name = "datatrash"
|
||||||
version = "1.1.6"
|
version = "1.1.7"
|
||||||
authors = ["neri"]
|
authors = ["neri"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,8 @@ CREATE TABLE IF NOT EXISTS files (
|
||||||
ALTER TABLE files ADD COLUMN IF NOT EXISTS delete_on_download boolean;
|
ALTER TABLE files ADD COLUMN IF NOT EXISTS delete_on_download boolean;
|
||||||
ALTER TABLE files ALTER COLUMN delete_on_download set not null;
|
ALTER TABLE files ALTER COLUMN delete_on_download set not null;
|
||||||
ALTER TABLE files ALTER COLUMN valid_till TYPE timestamptz;
|
ALTER TABLE files ALTER COLUMN valid_till TYPE timestamptz;
|
||||||
ALTER TABLE files DROP COLUMN IF EXISTS kind;
|
|
||||||
ALTER TABLE files ADD COLUMN IF NOT EXISTS content_type varchar(255);
|
ALTER TABLE files ADD COLUMN IF NOT EXISTS content_type varchar(255);
|
||||||
|
UPDATE files set content_type = 'text/plain' where kind = 'text';
|
||||||
|
UPDATE files set content_type = 'application/octet-stream' where kind = 'binary';
|
||||||
|
ALTER TABLE files ALTER COLUMN content_type set not null;
|
||||||
|
ALTER TABLE files DROP COLUMN IF EXISTS kind;
|
||||||
|
|
Loading…
Reference in New Issue