chore: adds settings ressource and migration
This commit is contained in:
parent
418b42d35a
commit
193618eace
4 changed files with 255 additions and 0 deletions
31
priv/repo/migrations/20251127134451_add_settings_table.exs
Normal file
31
priv/repo/migrations/20251127134451_add_settings_table.exs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
defmodule Mv.Repo.Migrations.AddSettingsTable do
|
||||
@moduledoc """
|
||||
Updates resources based on their most recent snapshots.
|
||||
|
||||
This file was autogenerated with `mix ash_postgres.generate_migrations`
|
||||
"""
|
||||
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
create table(:settings, primary_key: false) do
|
||||
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
|
||||
add :club_name, :text, null: false
|
||||
|
||||
add :inserted_at, :utc_datetime_usec,
|
||||
null: false,
|
||||
default: fragment("(now() AT TIME ZONE 'utc')")
|
||||
|
||||
add :updated_at, :utc_datetime_usec,
|
||||
null: false,
|
||||
default: fragment("(now() AT TIME ZONE 'utc')")
|
||||
end
|
||||
|
||||
# Note: Singleton pattern is enforced at application level via get_settings/0
|
||||
# which creates the record if it doesn't exist and only allows updates
|
||||
end
|
||||
|
||||
def down do
|
||||
drop table(:settings)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue