23
priv/repo/migrations/20180430071244_remove_uri.exs
Normal file
23
priv/repo/migrations/20180430071244_remove_uri.exs
Normal file
@@ -0,0 +1,23 @@
|
||||
defmodule Eventos.Repo.Migrations.RemoveUri do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table("accounts") do
|
||||
remove :uri
|
||||
end
|
||||
|
||||
alter table("groups") do
|
||||
remove :uri
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table("accounts") do
|
||||
add :uri, :string, null: false, default: "https://"
|
||||
end
|
||||
|
||||
alter table("groups") do
|
||||
add :uri, :string, null: false, default: "https://"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
defmodule Eventos.Repo.Migrations.AddUrlFieldToEvents do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table("events") do
|
||||
add :url, :string, null: false, default: "https://"
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table("events") do
|
||||
remove :url
|
||||
end
|
||||
end
|
||||
end
|
||||
17
priv/repo/migrations/20180515100237_create_comments.exs
Normal file
17
priv/repo/migrations/20180515100237_create_comments.exs
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateComments do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:comments) do
|
||||
add :url, :string
|
||||
add :text, :text
|
||||
|
||||
add :account_id, references(:accounts, on_delete: :nothing), null: false
|
||||
add :event_id, references(:events, on_delete: :nothing)
|
||||
add :in_reply_to_comment_id, references(:categories, on_delete: :nothing)
|
||||
add :origin_comment_id, references(:addresses, on_delete: :delete_all)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
defmodule Eventos.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table("events") do
|
||||
modify :inserted_at, :utc_datetime
|
||||
modify :updated_at, :utc_datetime
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table("events") do
|
||||
modify :inserted_at, :naive_datetime
|
||||
modify :updated_at, :naive_datetime
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
defmodule Eventos.Repo.Migrations.AddLocalAttributeToEventsAndComments do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table("events") do
|
||||
add :local, :boolean, null: false, default: true
|
||||
end
|
||||
|
||||
alter table("comments") do
|
||||
add :local, :boolean, null: false, default: true
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table("events") do
|
||||
remove :local
|
||||
end
|
||||
|
||||
alter table("comments") do
|
||||
remove :local
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user