-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SIM-DB-Decouple startup script in order to use plain postgres DB (#410)
* chore: use postgresql public image and add necessary alembic migration Signed-off-by: Agustín Ramiro Díaz <[email protected]> * fix: wrong action trigger Signed-off-by: Agustín Ramiro Díaz <[email protected]> * fix: trailing whitespace Signed-off-by: Agustín Ramiro Díaz <[email protected]> * fix: remove custom network Signed-off-by: Agustín Ramiro Díaz <[email protected]> * fix: remove feedbuzz network Signed-off-by: Agustín Ramiro Díaz <[email protected]> --------- Signed-off-by: Agustín Ramiro Díaz <[email protected]>
- Loading branch information
1 parent
9c481d9
commit 67cd3c4
Showing
7 changed files
with
90 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,6 @@ on: | |
secrets: | ||
dockerhub_token: | ||
required: true | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
permissions: | ||
contents: read | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
backend/database_handler/migration/versions/953de60a1dd8_init.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
"""init | ||
Revision ID: 953de60a1dd8 | ||
Revises: | ||
Create Date: 2024-08-21 09:34:07.525299 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "953de60a1dd8" | ||
down_revision: Union[str, None] = None | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"current_state", | ||
sa.Column("id", sa.String(length=255), nullable=False), | ||
sa.Column("data", postgresql.JSONB(astext_type=sa.Text()), nullable=False), | ||
sa.Column( | ||
"updated_at", | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text("CURRENT_TIMESTAMP"), | ||
nullable=True, | ||
), | ||
sa.PrimaryKeyConstraint("id", name="current_state_pkey"), | ||
) | ||
op.create_table( | ||
"transactions", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("from_address", sa.String(length=255), nullable=True), | ||
sa.Column("to_address", sa.String(length=255), nullable=True), | ||
sa.Column("input_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True), | ||
sa.Column("data", postgresql.JSONB(astext_type=sa.Text()), nullable=True), | ||
sa.Column( | ||
"consensus_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True | ||
), | ||
sa.Column("nonce", sa.Integer(), nullable=True), | ||
sa.Column("value", sa.Numeric(), nullable=True), | ||
sa.Column("type", sa.Integer(), nullable=True), | ||
sa.Column("gaslimit", sa.BigInteger(), nullable=True), | ||
sa.Column( | ||
"created_at", | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text("CURRENT_TIMESTAMP"), | ||
nullable=True, | ||
), | ||
sa.Column("r", sa.Integer(), nullable=True), | ||
sa.Column("s", sa.Integer(), nullable=True), | ||
sa.Column("v", sa.Integer(), nullable=True), | ||
sa.CheckConstraint( | ||
"type = ANY (ARRAY[0, 1, 2])", name="transactions_type_check" | ||
), | ||
sa.PrimaryKeyConstraint("id", name="transactions_pkey"), | ||
) | ||
op.create_table( | ||
"validators", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("stake", sa.Numeric(), nullable=False), | ||
sa.Column("config", postgresql.JSONB(astext_type=sa.Text()), nullable=False), | ||
sa.Column("address", sa.String(length=255), nullable=True), | ||
sa.Column("provider", sa.String(length=255), nullable=True), | ||
sa.Column("model", sa.String(length=255), nullable=True), | ||
sa.Column( | ||
"created_at", | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text("CURRENT_TIMESTAMP"), | ||
nullable=True, | ||
), | ||
sa.PrimaryKeyConstraint("id", name="validators_pkey"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("validators") | ||
op.drop_table("transactions") | ||
op.drop_table("current_state") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.