User table: ensure bio is always a string
Gets rid of '|| ""' in multiple places and fixes #2067
This commit is contained in:
parent
dc3a418c27
commit
126461942b
11 changed files with 27 additions and 10 deletions
|
|
@ -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
|
||||
10
priv/repo/migrations/20200901061637_bio_set_not_null.exs
Normal file
10
priv/repo/migrations/20200901061637_bio_set_not_null.exs
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue