forked from alemi/upub
fix!: attachment url no longer unique, add an index
This commit is contained in:
parent
2e7b7074ea
commit
4a3a2e2647
1 changed files with 5 additions and 1 deletions
|
@ -50,7 +50,7 @@ impl MigrationTrait for Migration {
|
||||||
.primary_key()
|
.primary_key()
|
||||||
.auto_increment()
|
.auto_increment()
|
||||||
)
|
)
|
||||||
.col(ColumnDef::new(Attachments::Url).string().not_null().unique_key())
|
.col(ColumnDef::new(Attachments::Url).string().not_null())
|
||||||
.col(ColumnDef::new(Attachments::Object).big_integer().not_null())
|
.col(ColumnDef::new(Attachments::Object).big_integer().not_null())
|
||||||
.foreign_key(
|
.foreign_key(
|
||||||
ForeignKey::create()
|
ForeignKey::create()
|
||||||
|
@ -72,6 +72,10 @@ impl MigrationTrait for Migration {
|
||||||
.create_index(Index::create().name("index-attachment-object").table(Attachments::Table).col(Attachments::Object).to_owned())
|
.create_index(Index::create().name("index-attachment-object").table(Attachments::Table).col(Attachments::Object).to_owned())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
manager
|
||||||
|
.create_index(Index::create().name("index-attachment-url").table(Attachments::Table).col(Attachments::Url).to_owned())
|
||||||
|
.await?;
|
||||||
|
|
||||||
manager
|
manager
|
||||||
.create_table(
|
.create_table(
|
||||||
Table::create()
|
Table::create()
|
||||||
|
|
Loading…
Reference in a new issue