Skip to content

Commit fdfd65b

Browse files
authored
Revert "Add missing messageattempt index" (#2196)
Reverts #2187
1 parent 462e041 commit fdfd65b

File tree

6 files changed

+3
-239
lines changed

6 files changed

+3
-239
lines changed

server/Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/svix-server/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ enum_dispatch = "0.3.8"
3737
figment = { version = "0.10", features = ["toml", "env", "test"] }
3838
form_urlencoded = "1.1.0"
3939
futures = "0.3"
40-
futures-util = "0.3.30"
4140
hex = "0.4.3"
4241
hickory-resolver = "0.25.2"
4342
hmac-sha256 = "1"

server/svix-server/migrations/20260217191753_messageattempt_per_endp_no_status_autocommit.down.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

server/svix-server/migrations/20260217191753_messageattempt_per_endp_no_status_autocommit.up.sql

Lines changed: 0 additions & 6 deletions
This file was deleted.

server/svix-server/src/db/migrator.rs

Lines changed: 0 additions & 203 deletions
This file was deleted.

server/svix-server/src/db/mod.rs

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
use sea_orm::{
55
ColumnTrait, DatabaseConnection, DbBackend, DeleteResult, EntityTrait, QueryFilter,
6-
SqlxPostgresConnector, sqlx::migrate::Migrate,
6+
SqlxPostgresConnector,
77
};
88
use sqlx::postgres::PgPoolOptions;
99

10-
use crate::{cfg::Configuration, core::types::OrganizationId, db::migrator::TxnOptionalMigrator};
10+
use crate::{cfg::Configuration, core::types::OrganizationId};
1111

12-
pub mod migrator;
1312
pub mod models;
1413
use models::{application, endpoint, eventtype, message, messageattempt};
1514

@@ -33,30 +32,7 @@ pub async fn init_db(cfg: &Configuration) -> DatabaseConnection {
3332

3433
pub async fn run_migrations(cfg: &Configuration) {
3534
let db = connect(&cfg.db_dsn, cfg.db_pool_max_size).await;
36-
let (version, description) = MIGRATIONS
37-
.migrations
38-
.last()
39-
.map(|m| (m.version, &m.description))
40-
.expect("Where the migrations at?");
41-
42-
tracing::info!("Migrations: starting (most recent in source: {version} '{description}')");
43-
44-
// sqlx::Pool only runs migrations in a transaction, which prevents us from doing things
45-
// like CREATE INDEX CONCURRENTLY . . .
46-
// So we wrap our pools in a special migrator type that avoids transactions.
47-
let mut migrator = TxnOptionalMigrator::new("db", &db).await;
48-
49-
tracing::info!("Migrating database");
50-
migrator
51-
.ensure_migrations_table()
52-
.await
53-
.expect("Failed to ensure db");
54-
MIGRATIONS
55-
.run_direct(&mut migrator)
56-
.await
57-
.expect("Unable to migrate db");
58-
59-
tracing::info!("Migrations: Done!");
35+
MIGRATIONS.run(&db).await.unwrap();
6036
}
6137

6238
/// Wipe an organization from existence in a way that ensures the operation can be tried again on

0 commit comments

Comments
 (0)