Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
deankarn committed Sep 23, 2023
1 parent 018b5c7 commit 52c321f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions relay-backend-postgres/migrations/1695506628848_bytea.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE jobs ALTER COLUMN data TYPE text;
ALTER TABLE jobs ALTER COLUMN state TYPE text;
ALTER TABLE jobs ALTER COLUMN data TYPE bytea USING data::bytea;
ALTER TABLE jobs ALTER COLUMN state TYPE bytea USING state::bytea;
14 changes: 10 additions & 4 deletions relay-backend-postgres/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ use tokio_postgres::{Config as PostgresConfig, Row};
use tokio_stream::{Stream, StreamExt};
use tracing::{debug, warn};

const MIGRATIONS: [Migration; 1] = [Migration::new(
"1678464484380_initialize.sql",
include_str!("../migrations/1678464484380_initialize.sql"),
)];
const MIGRATIONS: [Migration; 2] = [
Migration::new(
"1678464484380_initialize.sql",
include_str!("../migrations/1678464484380_initialize.sql"),
),
Migration::new(
"1695506628848_bytea.sql",
include_str!("../migrations/1695506628848_bytea.sql"),
),
];

/// `RawJob` represents a Relay Job for the Postgres backend.
type RawJob = Job<Box<RawValue>, Box<RawValue>>;
Expand Down

0 comments on commit 52c321f

Please sign in to comment.