Giter Site home page Giter Site logo

Comments (6)

a8m avatar a8m commented on July 28, 2024 1

A file directive should be separated by two newlines from the first statement's comment.

Closing as the issue was resolved. You're more than welcome to join our Discord server in case you need more help with it.

from atlas.

rotemtam avatar rotemtam commented on July 28, 2024 1

Use atlas migrate hash

from atlas.

a8m avatar a8m commented on July 28, 2024

I think setting txmode to none in the create_indexes.sql file should solve the issue, because the default behavior is running each file within a transaction. See: https://atlasgo.io/versioned/apply#file-level-transaction-mode

Can you try this and report if that solves the issue?

from atlas.

vmrm avatar vmrm commented on July 28, 2024

I've tried using https://atlasgo.io/versioned/apply#file-level-transaction-mode

  20230712165923_create_indexes.sql: |
    -- atlas:txmode none
    -- Create index "bookings.facid_memid" to table: "bookings"
    CREATE INDEX CONCURRENTLY "bookings.facid_memid" ON "cd"."bookings" ("facid", "memid");
    -- Create index "bookings.facid_starttime" to table: "bookings"
    CREATE INDEX CONCURRENTLY "bookings.facid_starttime" ON "cd"."bookings" ("facid", "starttime");
    -- Create index "bookings.memid_facid" to table: "bookings"
    CREATE INDEX CONCURRENTLY "bookings.memid_facid" ON "cd"."bookings" ("memid", "facid");
    -- Create index "bookings.memid_starttime" to table: "bookings"
    CREATE INDEX CONCURRENTLY "bookings.memid_starttime" ON "cd"."bookings" ("memid", "starttime");
    -- Create index "bookings.starttime" to table: "bookings"
    CREATE INDEX CONCURRENTLY "bookings.starttime" ON "cd"."bookings" ("starttime");
    -- Create index "members.joindate" to table: "members"
    CREATE INDEX CONCURRENTLY "members.joindate" ON "cd"."members" ("joindate");
    -- Create index "members.recommendedby" to table: "members"
    CREATE INDEX CONCURRENTLY "members.recommendedby" ON "cd"."members" ("recommendedby");

but still getting the:

Status:
  Conditions:
    Last Transition Time:  2023-07-17T18:15:58Z
    Message:               sql/migrate: sql/migrate: execute: executing statement "CREATE INDEX CONCURRENTLY \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\");" from version "20230712165923": pq: CREATE INDEX CONCURRENTLY cannot run inside a transaction block: sql/migrate: execute: write revision: pq: current transaction is aborted, commands ignored until end of transaction block
    Reason:                Reconciling
    Status:                False
    Type:                  Ready

After changing file to:

  20230712165923_create_indexes.sql: |
    -- atlas:txmode none

    CREATE INDEX CONCURRENTLY "bookings.facid_memid" ON "cd"."bookings" ("facid", "memid");
    CREATE INDEX CONCURRENTLY "bookings.facid_starttime" ON "cd"."bookings" ("facid", "starttime");
    CREATE INDEX CONCURRENTLY "bookings.memid_facid" ON "cd"."bookings" ("memid", "facid");
    CREATE INDEX CONCURRENTLY "bookings.memid_starttime" ON "cd"."bookings" ("memid", "starttime");
    CREATE INDEX CONCURRENTLY "bookings.starttime" ON "cd"."bookings" ("starttime");
    CREATE INDEX CONCURRENTLY "members.joindate" ON "cd"."members" ("joindate");
    CREATE INDEX CONCURRENTLY "members.recommendedby" ON "cd"."members" ("recommendedby");
Status:
  Conditions:
    Last Transition Time:  2023-07-17T18:20:20Z
    Message:
    Reason:                Applied
    Status:                True
    Type:                  Ready
  Last Applied:            1689618018
  Last Applied Version:    20230712165923
  observed_hash:           d721437cb2fc4821a74764784a86d7feb6e4da758b40df28a7bac07151edf7ec

everything worked as expected. Thanks! Not sure if comments are breaking some parsing.

from atlas.

vmrm avatar vmrm commented on July 28, 2024

Thanks a lot for your help!

from atlas.

hosseindehghanpoor avatar hosseindehghanpoor commented on July 28, 2024

@vmrm
how did you calculate atlas.sum ?
can you explain it to me

atlas.sum: |
h1:xTbw3AxHRH3YSW7dOGteMxvcigM3f/Y7pdkwwScmbGM=
20230712165510_create_tables.sql h1:BWXssdgcYxJcYSNOaK7bYlhgB5LsumtrNXiBfkC3HiU=
20230712165923_create_indexes.sql h1:WQxGEQSGBr+QCZQB+/cRZ84Ei8Br2iJ9nbwC9/k2oW8=

from atlas.

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.