fix db migration

master
neri 2 months ago
parent 1527445857
commit 44aa90369d
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 4
      init-db.sql

2
Cargo.lock generated

@ -427,7 +427,7 @@ dependencies = [
[[package]]
name = "datatrash"
version = "1.1.5"
version = "1.1.7"
dependencies = [
"actix-files",
"actix-governor",

@ -1,6 +1,6 @@
[package]
name = "datatrash"
version = "1.1.6"
version = "1.1.7"
authors = ["neri"]
edition = "2021"

@ -10,5 +10,7 @@ CREATE TABLE IF NOT EXISTS files (
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 valid_till TYPE timestamptz;
ALTER TABLE files ADD COLUMN IF NOT EXISTS content_type varchar(255) not null
GENERATED ALWAYS AS (CASE WHEN kind = 'text' THEN 'text/plain' ELSE 'application/octet-stream' END) STORED;
ALTER TABLE files ALTER COLUMN content_type DROP EXPRESSION IF EXISTS;
ALTER TABLE files DROP COLUMN IF EXISTS kind;
ALTER TABLE files ADD COLUMN IF NOT EXISTS content_type varchar(255);

Loading…
Cancel
Save