Comments (6)
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.
Use atlas migrate hash
from atlas.
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.
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.
Thanks a lot for your help!
from atlas.
@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)
- Clickhouse Error: modify primary key is not supported HOT 2
- atlas fmt check only HOT 2
- Clickhouse migrations failing for atlas 0.22 HOT 1
- Support schema-hooks
- unknown driver "sqlserver" HOT 3
- Unable to handle mysql column with INVISIBLE attribute HOT 1
- incomplete output when creating trigger for Sqlite HOT 1
- Atlas Schema Diff: DDL Generation for Comments on Tables
- atlas-operator collation mismatch when using MariaDB HOT 1
- `pq: syntax error at or near "NULLS"` (`NULLS NOT DISTINCT` in the wrong place)
- Clickhouse integration fails with unhelpful error HOT 3
- Feature Request: Support for Kafka Engine Type for ClickHouse HOT 1
- atlas_schema_revisions gets too big for large manually created migration files (postgres)
- allow customizing non-linear changes lint behaviour
- atlas-provider-django install fails due to mysqlclient: Cannot find valid pkg-config name. HOT 1
- issue inspecting clickhouse schema HOT 2
- Default null arg for stored procedures not supported HOT 3
- Error: postgres: unexpected trigger relation kind "p" HOT 2
- SQL Server driver generating invalid SQL for down migration pre-checks HOT 1
- Invalid definitions for COLUMNSTORE and SPATIAL Indexes for SQL Server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlas.