update
This commit is contained in:
parent
e2967f68b2
commit
ef2a6c41b4
39 changed files with 2349 additions and 30 deletions
11
priv/repo/migrations/20241022022614_create_images.exs
Normal file
11
priv/repo/migrations/20241022022614_create_images.exs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Zoeyscomputer.Repo.Migrations.CreateImages do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:images) do
|
||||
add :file, :string
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
end
|
||||
end
|
||||
16
priv/repo/migrations/20241022033717_create_api_keys.exs
Normal file
16
priv/repo/migrations/20241022033717_create_api_keys.exs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
defmodule Zoeyscomputer.Repo.Migrations.CreateApiKeys do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:api_keys) do
|
||||
add :token, :string
|
||||
add :name, :string
|
||||
add :user_id, references(:users, on_delete: :nothing)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create unique_index(:api_keys, [:token])
|
||||
create index(:api_keys, [:user_id])
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
defmodule Zoeyscomputer.Repo.Migrations.AddUserImageField do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:images) do
|
||||
add :user_id, references(:users, on_delete: :nothing)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue