From eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 Mon Sep 17 00:00:00 2001 From: "Elizabeth (Lizzy) Hunt" Date: Mon, 29 May 2023 16:28:27 -0700 Subject: Bots (#23) * squash all the things for bots * fix warnings * change colors a bit and README updates * fix frontend warnings --- priv/repo/migrations/20230529193504_add_bots.exs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 priv/repo/migrations/20230529193504_add_bots.exs (limited to 'priv/repo/migrations/20230529193504_add_bots.exs') diff --git a/priv/repo/migrations/20230529193504_add_bots.exs b/priv/repo/migrations/20230529193504_add_bots.exs new file mode 100644 index 0000000..3f48c0a --- /dev/null +++ b/priv/repo/migrations/20230529193504_add_bots.exs @@ -0,0 +1,22 @@ +defmodule Chessh.Repo.Migrations.AddBots do + use Ecto.Migration + + def change do + create table(:bots) do + add(:name, :citext, null: false) + add(:webhook, :string, null: false) + add(:token, :string, null: false) + add(:public, :boolean, null: false) + add(:player_id, references(:players), null: false) + + timestamps() + end + + create(unique_index(:bots, [:name])) + create(unique_index(:bots, [:token])) + + alter table(:games) do + add(:bot_id, references(:bots), null: true) + end + end +end -- cgit v1.2.3-70-g09d2