Skip to content

Commit

Permalink
chore: merge migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
lok52 committed Nov 5, 2024
1 parent 2f2316b commit 5f9669c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DROP TABLE IF EXISTS api_keys;
DROP TABLE IF EXISTS addresses;
DROP TABLE IF EXISTS block_ranges;
DROP TABLE IF EXISTS dapps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ CREATE TABLE hashes (
created_at timestamp NOT NULL DEFAULT (now()),
PRIMARY KEY (hash, chain_id)
);

CREATE TABLE api_keys (
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
key UUID NOT NULL UNIQUE,
chain_id bigint NOT NULL REFERENCES chains (id),
created_at TIMESTAMP NOT NULL DEFAULT (now())
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ pub use sea_orm_migration::prelude::*;
use sea_orm_migration::sea_orm::{Statement, TransactionTrait};

mod m20220101_000001_initial_tables;
mod m20241031_064924_add_api_keys;

pub struct Migrator;

#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![
Box::new(m20220101_000001_initial_tables::Migration),
Box::new(m20241031_064924_add_api_keys::Migration),
]
vec![Box::new(m20220101_000001_initial_tables::Migration)]
}
}

Expand Down

This file was deleted.

0 comments on commit 5f9669c

Please sign in to comment.