summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-01 09:32:01 +0000
committerlain <lain@soykaf.club>2020-09-01 09:32:01 +0000
commitd48755791ddfea0b30bc5a843dfc4181efd63982 (patch)
treedda738dce0a6236e835650abf752d6ec779803ba /priv
parent9d63b2c9db88ffdeb608df427caf2996eb0bb094 (diff)
parent126461942b63bbb74900f296ebcee72d2a33f3d2 (diff)
downloadpleroma-d48755791ddfea0b30bc5a843dfc4181efd63982.tar.gz
pleroma-d48755791ddfea0b30bc5a843dfc4181efd63982.zip
Merge branch 'fix/static-fe-nil-bio-crash' into 'develop'
User table: ensure bio is always a string Closes #2067 See merge request pleroma/pleroma!2938
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200901061256_ensure_bio_is_string.exs7
-rw-r--r--priv/repo/migrations/20200901061637_bio_set_not_null.exs10
2 files changed, 17 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200901061256_ensure_bio_is_string.exs b/priv/repo/migrations/20200901061256_ensure_bio_is_string.exs
new file mode 100644
index 000000000..0e3bb3c81
--- /dev/null
+++ b/priv/repo/migrations/20200901061256_ensure_bio_is_string.exs
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.EnsureBioIsString do
+ use Ecto.Migration
+
+ def change do
+ execute("update users set bio = '' where bio is null", "")
+ end
+end
diff --git a/priv/repo/migrations/20200901061637_bio_set_not_null.exs b/priv/repo/migrations/20200901061637_bio_set_not_null.exs
new file mode 100644
index 000000000..e3a67d4e7
--- /dev/null
+++ b/priv/repo/migrations/20200901061637_bio_set_not_null.exs
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.BioSetNotNull do
+ use Ecto.Migration
+
+ def change do
+ execute(
+ "alter table users alter column bio set not null",
+ "alter table users alter column bio drop not null"
+ )
+ end
+end