You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
817 B
31 lines
817 B
defmodule DecentralisedBookIndex.Repo.Migrations.CreateBooks 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(:books, primary_key: false) do
|
|
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
|
|
add :title, :text, null: false
|
|
add :isbn, :text, null: false
|
|
add :description, :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
|
|
end
|
|
|
|
def down do
|
|
drop table(:books)
|
|
end
|
|
end
|