This commit is contained in:
zack 2024-10-22 16:51:56 -04:00
parent e2967f68b2
commit ef2a6c41b4
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
39 changed files with 2349 additions and 30 deletions

View 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

View 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

View file

@ -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