Giter VIP home page Giter VIP logo

Comments (5)

xzkostyan avatar xzkostyan commented on July 18, 2024

Hi.

This is how alembic works. In case of postgresql alembic_version stores only one row. If you combine this mechanism with Replacing engine rows will disappear after merge.

from clickhouse-sqlalchemy.

vikrant-mah-dhimate avatar vikrant-mah-dhimate commented on July 18, 2024

@xzkostyan May I know what is the way we can handle both expand and contract migrations in clickhouse cluster mode by persisting both expand and contract revisions (same as how it does for psql, as we are using postgresql and it works correctly for postgresql by persisting both version_ids)?

from clickhouse-sqlalchemy.

xzkostyan avatar xzkostyan commented on July 18, 2024

same as how it does for psql, as we are using postgresql and it works correctly for postgresql by persisting both version_ids

Can you provide example for PG?

from clickhouse-sqlalchemy.

vikrant-mah-dhimate avatar vikrant-mah-dhimate commented on July 18, 2024

@xzkostyan here is the code snippet and postgres snippet attached.
image

sample=# select * from alembic_version ;
 version_num
--------------
 314abe8f5fce
 9e15486b29e1
(2 rows)

sample=#
sample=#
sample=# \d alembic_version
                    Table "public.alembic_version"
   Column    |         Type          | Collation | Nullable | Default
-------------+-----------------------+-----------+----------+---------
 version_num | character varying(32) |           | not null |
Indexes:
    "alembic_version_pkc" PRIMARY KEY, btree (version_num)

sample=#

Additionally, the executions are triggered by providing expand and contract BRANCH in below docker command.

docker run --pull=always --rm \
        -v ${PWD}/../${SERVICE}/migrations/contract:/alembic/contract \
        -v ${PWD}/../${SERVICE}/migrations/expand:/alembic/expand \
        --net default \
        -e "POSTGRES_USERNAME=" \
        -e "POSTGRES_PASSWORD=" \
        -e "POSTGRES_HOST=" \
        -e "POSTGRES_PORT=5432" \
        -e "POSTGRES_DB_NAME=" \
        -e "POSTGRES_MANAGED_DB_NAME=${SERVICE}"\
        -e "POSTGRES_MANAGED_PASSWORD="\
        alembic:1.13 \
        upgrade ${BRANCH}@head
        ```

from clickhouse-sqlalchemy.

vikrant-mah-dhimate avatar vikrant-mah-dhimate commented on July 18, 2024

@xzkostyan could you please check the above code and suggest for clickhouse?
cc: @s-dhamodhran @arunmahendran

from clickhouse-sqlalchemy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.