2023-12-04 14:15:25 +00:00
|
|
|
defmodule BoardWise.Repo.Migrations.CreateCoaches do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
2023-12-04 19:30:38 +00:00
|
|
|
@prefix "coach_scraper"
|
|
|
|
|
2023-12-04 14:15:25 +00:00
|
|
|
def change do
|
2023-12-04 19:30:38 +00:00
|
|
|
execute "CREATE SCHEMA coach_scraper"
|
2023-12-04 14:15:25 +00:00
|
|
|
|
2023-12-04 19:30:38 +00:00
|
|
|
create table(:export, prefix: @prefix) do
|
|
|
|
add :site, :string, null: false
|
|
|
|
add :username, :string, null: false
|
2023-12-04 14:15:25 +00:00
|
|
|
add :rapid, :integer
|
|
|
|
add :blitz, :integer
|
|
|
|
add :bullet, :integer
|
|
|
|
end
|
2023-12-04 19:30:38 +00:00
|
|
|
|
|
|
|
create unique_index(
|
|
|
|
:export,
|
|
|
|
[:site, :username],
|
|
|
|
prefix: @prefix,
|
|
|
|
name: "site_username_unique"
|
|
|
|
)
|
2023-12-04 14:15:25 +00:00
|
|
|
end
|
|
|
|
end
|