refactor: implicitly declare primary keys names

This commit is contained in:
Suiranoil
2023-07-04 19:03:24 +03:00
parent 0805c59a7b
commit d83e507913
3 changed files with 6 additions and 6 deletions

View File

@@ -15,8 +15,7 @@ impl MigrationTrait for Migration {
ColumnDef::new(Guilds::Id)
.integer()
.not_null()
.auto_increment()
.primary_key(),
.auto_increment(),
)
.col(
ColumnDef::new(Guilds::GuildId)
@@ -30,6 +29,7 @@ impl MigrationTrait for Migration {
.not_null()
.default(false),
)
.primary_key(Index::create().name("guilds_pkey").col(Guilds::Id))
.to_owned(),
)
.await?;

View File

@@ -14,8 +14,7 @@ impl MigrationTrait for Migration {
ColumnDef::new(Lobbies::Id)
.integer()
.not_null()
.auto_increment()
.primary_key(),
.auto_increment(),
)
.col(ColumnDef::new(Lobbies::GuildId).big_unsigned().not_null())
.col(
@@ -33,6 +32,7 @@ impl MigrationTrait for Migration {
.big_unsigned()
.not_null(),
)
.primary_key(Index::create().name("lobbies_pkey").col(Lobbies::Id))
.to_owned(),
)
.await?;

View File

@@ -14,8 +14,7 @@ impl MigrationTrait for Migration {
ColumnDef::new(Players::Id)
.integer()
.not_null()
.auto_increment()
.primary_key(),
.auto_increment(),
)
.col(
ColumnDef::new(Players::DiscordId)
@@ -89,6 +88,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Players::PrimaryRole).custom(Role))
.col(ColumnDef::new(Players::SecondaryRole).custom(Role))
.col(ColumnDef::new(Players::TertiaryRole).custom(Role))
.primary_key(Index::create().name("players_pkey").col(Players::Id))
.to_owned(),
)
.await?;