refactor: implicitly declare primary keys names
This commit is contained in:
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user