@@ -2,7 +2,7 @@ defmodule Galaxies.Repo.Migrations.CreateEventQueueTables do
2
2
@ moduledoc """
3
3
Defines an event queue to serialize all events happening on any given planet.
4
4
When wanting to move time forward for a given planet, the game can read from
5
- the planet event queue and execute all events by order. Processing the events
5
+ the planet event queue and execute all events in order. Processing the events
6
6
for one planet does not affect any other events.
7
7
Keep in mind that player actions may cause events in the queue to be
8
8
cancelled (e.g. cancelling an attack) or postponed (sending more ships to an
@@ -13,7 +13,7 @@ defmodule Galaxies.Repo.Migrations.CreateEventQueueTables do
13
13
def change do
14
14
create table ( :planet_events , primary_key: false ) do
15
15
add :id , :binary_id , primary_key: true
16
- add :planet_id , references ( :planets , type: :binary_id , on_delete: :delete_all ) , null: false
16
+ add :planet_id , references ( :planets , type: :serial , on_delete: :delete_all ) , null: false
17
17
# specifies which table to fetch event from (e.g. planet_building_queue, fleet, etc).
18
18
add :type , :integer , null: false
19
19
# event data is polymorphic and depends on event type
@@ -31,7 +31,7 @@ defmodule Galaxies.Repo.Migrations.CreateEventQueueTables do
31
31
32
32
create table ( :planet_build_queue , primary_key: false ) do
33
33
add :id , :binary_id , primary_key: true
34
- add :planet_id , references ( :planets , type: :binary_id , on_delete: :delete_all ) , null: false
34
+ add :planet_id , references ( :planets , type: :serial , on_delete: :delete_all ) , null: false
35
35
36
36
add :building_id , references ( :buildings , on_delete: :delete_all ) , null: false
37
37
0 commit comments