Migrate deprecated create_if_not_exists

This commit is contained in:
Valentin Tolmer 2021-05-08 13:08:57 +02:00
parent f8951d3b82
commit d771293a43

View File

@ -40,7 +40,7 @@ pub async fn init_table(pool: &Pool) -> sqlx::Result<()> {
sqlx::query(
&Table::create()
.table(Users::Table)
.create_if_not_exists()
.if_not_exists()
.col(
ColumnDef::new(Users::UserId)
.string_len(255)
@ -67,7 +67,7 @@ pub async fn init_table(pool: &Pool) -> sqlx::Result<()> {
sqlx::query(
&Table::create()
.table(Groups::Table)
.create_if_not_exists()
.if_not_exists()
.col(
ColumnDef::new(Groups::GroupId)
.integer()
@ -86,7 +86,7 @@ pub async fn init_table(pool: &Pool) -> sqlx::Result<()> {
sqlx::query(
&Table::create()
.table(Memberships::Table)
.create_if_not_exists()
.if_not_exists()
.col(
ColumnDef::new(Memberships::UserId)
.string_len(255)