Skip to content

Commit

Permalink
fix migration not null
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Aug 23, 2024
1 parent f736669 commit 561a655
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions backend/migration/src/m20231207_000001_create_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ pub enum Problem {
Time,
Difficulty,
Public,
Tags,
Title,
Content,
CreateAt,
Expand Down Expand Up @@ -334,7 +333,7 @@ impl MigrationTrait for Migration {
.to(User::Table, User::Id)
.on_delete(ForeignKeyAction::SetNull),
)
.col(ColumnDef::new(Problem::ContestId).integer().not_null())
.col(ColumnDef::new(Problem::ContestId).integer().null())
.foreign_key(
ForeignKey::create()
.name("fk-problem-contest")
Expand Down Expand Up @@ -374,7 +373,6 @@ impl MigrationTrait for Migration {
.not_null()
.default(false),
)
.col(ColumnDef::new(Problem::Tags).text().not_null().default(""))
.col(ColumnDef::new(Problem::Title).text().not_null())
.col(
ColumnDef::new(Problem::Content)
Expand Down Expand Up @@ -658,16 +656,6 @@ impl MigrationTrait for Migration {
)
.await?;

manager
.create_index(
Index::create()
.name("idx-problem-text")
.table(Problem::Table)
.col(Problem::Tags)
.col(Problem::Title)
.to_owned(),
)
.await?;
manager
.create_index(
Index::create()
Expand Down

0 comments on commit 561a655

Please sign in to comment.