-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change waydowntown to share registrations database
This feel like a triumph 🤪
- Loading branch information
Showing
14 changed files
with
199 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cd ../waydowntown/waydowntown_server | ||
bundle exec rake db:schema:dump | ||
bundle exec rubocop -A db/schema.rb > /dev/null | ||
echo "waydowntown server schema dumped successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
registrations/priv/repo/migrations/20240630162659_add_waydowntown_schema.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule Registrations.Repo.Migrations.AddWaydowntownSchema do | ||
use Ecto.Migration | ||
|
||
def up do | ||
execute("CREATE SCHEMA waydowntown") | ||
end | ||
|
||
def down do | ||
execute("DROP SCHEMA waydowntown") | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
registrations/priv/repo/migrations/20240630162710_add_waydowntown_incarnations.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Registrations.Repo.Migrations.AddWaydowntownIncarnations do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:incarnations, prefix: "waydowntown", primary_key: false) do | ||
add(:id, :uuid, primary_key: true, default: fragment("gen_random_uuid()")) | ||
add(:concept, :string) | ||
add(:mask, :string) | ||
add(:answer, :string) | ||
|
||
timestamps() | ||
end | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
registrations/priv/repo/migrations/20240630162715_add_waydowntown_games.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Registrations.Repo.Migrations.AddWaydowntownGames do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:games, prefix: "waydowntown", primary_key: false) do | ||
add(:id, :uuid, primary_key: true, default: fragment("gen_random_uuid()")) | ||
add(:incarnation_id, references("incarnations", type: :uuid)) | ||
|
||
timestamps() | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class Game < ApplicationRecord | ||
self.table_name = 'waydowntown.games' | ||
|
||
belongs_to :incarnation | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Incarnation < ApplicationRecord | ||
self.table_name = 'waydowntown.incarnations' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
waydowntown/waydowntown_server/db/migrate/20240622195313_create_incarnations.rb
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
waydowntown/waydowntown_server/db/migrate/20240628151327_create_games.rb
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.