2024-09-08 12:35:20 +00:00
|
|
|
defmodule DrainCloudCore.Repo.Migrations.AddUsers do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:users) do
|
2024-09-08 22:19:41 +00:00
|
|
|
add :login, :string, size: 120
|
2024-09-08 12:35:20 +00:00
|
|
|
add :password, :string
|
2024-09-08 22:19:41 +00:00
|
|
|
add :created_at, :utc_datetime, null: false, default: fragment("CURRENT_TIMESTAMP")
|
|
|
|
add :updated_at, :utc_datetime, null: false, default: fragment("CURRENT_TIMESTAMP")
|
|
|
|
add :deleted_at, :utc_datetime, null: true, default: nil
|
2024-09-08 12:35:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
create unique_index(:users, :login)
|
|
|
|
end
|
|
|
|
end
|