Setting up Posts and Posts.Tweet
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
defmodule Mixer.Repo.Migrations.SetupPostsAndTweets 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(:tweets, primary_key: false) do
|
||||
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
|
||||
add :content, :text, null: false
|
||||
|
||||
add :user_id,
|
||||
references(:users,
|
||||
column: :id,
|
||||
name: "tweets_user_id_fkey",
|
||||
type: :uuid,
|
||||
prefix: "public"
|
||||
), null: false
|
||||
|
||||
add :state, :text, null: false, default: "drafted"
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
drop constraint(:tweets, "tweets_user_id_fkey")
|
||||
|
||||
drop table(:tweets)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user