diff options
Diffstat (limited to 'priv')
5 files changed, 83 insertions, 0 deletions
| diff --git a/priv/repo/migrations/20191026190317_set_not_null_for_activities.exs b/priv/repo/migrations/20191026190317_set_not_null_for_activities.exs new file mode 100644 index 000000000..9b66f3cff --- /dev/null +++ b/priv/repo/migrations/20191026190317_set_not_null_for_activities.exs @@ -0,0 +1,17 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForActivities do +  use Ecto.Migration + +  # modify/3 function will require index recreation, so using execute/1 instead + +  def up do +    execute("ALTER TABLE activities +    ALTER COLUMN data SET NOT NULL, +    ALTER COLUMN local SET NOT NULL") +  end + +  def down do +    execute("ALTER TABLE activities +    ALTER COLUMN data DROP NOT NULL, +    ALTER COLUMN local DROP NOT NULL") +  end +end diff --git a/priv/repo/migrations/20191026190415_set_not_null_for_activity_expirations.exs b/priv/repo/migrations/20191026190415_set_not_null_for_activity_expirations.exs new file mode 100644 index 000000000..e41c69e4c --- /dev/null +++ b/priv/repo/migrations/20191026190415_set_not_null_for_activity_expirations.exs @@ -0,0 +1,15 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForActivityExpirations do +  use Ecto.Migration + +  # modify/3 function will require index recreation, so using execute/1 instead + +  def up do +    execute("ALTER TABLE activity_expirations +    ALTER COLUMN activity_id SET NOT NULL") +  end + +  def down do +    execute("ALTER TABLE activity_expirations +    ALTER COLUMN activity_id DROP NOT NULL") +  end +end diff --git a/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs b/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs new file mode 100644 index 000000000..a6a44ddfe --- /dev/null +++ b/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs @@ -0,0 +1,17 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForApps do +  use Ecto.Migration + +  # modify/3 function will require index recreation, so using execute/1 instead + +  def up do +    execute("ALTER TABLE apps +    ALTER COLUMN client_name SET NOT NULL, +    ALTER COLUMN redirect_uris SET NOT NULL") +  end + +  def down do +    execute("ALTER TABLE apps +    ALTER COLUMN client_name DROP NOT NULL, +    ALTER COLUMN redirect_uris DROP NOT NULL") +  end +end diff --git a/priv/repo/migrations/20191026190533_set_not_null_for_bookmarks.exs b/priv/repo/migrations/20191026190533_set_not_null_for_bookmarks.exs new file mode 100644 index 000000000..5f3224003 --- /dev/null +++ b/priv/repo/migrations/20191026190533_set_not_null_for_bookmarks.exs @@ -0,0 +1,17 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForBookmarks do +  use Ecto.Migration + +  # modify/3 function will require index recreation, so using execute/1 instead + +  def up do +    execute("ALTER TABLE bookmarks +    ALTER COLUMN user_id SET NOT NULL, +    ALTER COLUMN activity_id SET NOT NULL") +  end + +  def down do +    execute("ALTER TABLE bookmarks +    ALTER COLUMN user_id DROP NOT NULL, +    ALTER COLUMN activity_id DROP NOT NULL") +  end +end diff --git a/priv/repo/migrations/20191026190622_set_not_null_for_config.exs b/priv/repo/migrations/20191026190622_set_not_null_for_config.exs new file mode 100644 index 000000000..204272442 --- /dev/null +++ b/priv/repo/migrations/20191026190622_set_not_null_for_config.exs @@ -0,0 +1,17 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForConfig do +  use Ecto.Migration + +  # modify/3 function will require index recreation, so using execute/1 instead + +  def up do +    execute("ALTER TABLE config +    ALTER COLUMN key SET NOT NULL, +    ALTER COLUMN value SET NOT NULL") +  end + +  def down do +    execute("ALTER TABLE config +    ALTER COLUMN key DROP NOT NULL, +    ALTER COLUMN value DROP NOT NULL") +  end +end | 
