Значительно изменил бд и генерацию так же добавил роли

This commit is contained in:
2026-03-25 20:44:28 +05:00
parent 0aeffffa56
commit d16af289fe
14 changed files with 485 additions and 67 deletions

View File

@@ -13,6 +13,14 @@ Sequel.migration do
column :rarity, String
column :type, String
# Уникальность имени карты
add_unique_constraint :name
# Ограничения
constraint(:valid_rarity, Sequel.lit("rarity IN ('common','rare','epic','legendary','champion', 'evo', 'hero')"))
constraint(:valid_type, Sequel.lit("type IN ('troop','spell','building')"))
constraint(:positive_elixir, Sequel.lit("elixir_cost >= 0"))
# 0/1 флаг: карточка в актуальной мете или нет.
# Можно позже заменить на true/false, если решим хранить boolean.
column :is_meta, Integer, default: 0
@@ -20,6 +28,7 @@ Sequel.migration do
# Технические таймстемпы для аудита и сортировки
column :created_at, DateTime, null: false, default: Sequel::CURRENT_TIMESTAMP
column :updated_at, DateTime, null: false, default: Sequel::CURRENT_TIMESTAMP
end
end
end