Comments (6)
Fixed with #811. Thanks @amrnt 🙏
from atlas.
Thanks for reporting this @amrnt 🙏
from atlas.
@a8m, I tried to change the StorageKey
of an edge, it will drop and create the CONSTRAINT
but the order of it will yield to errors as the same issue, the column is removed before the constraint:
edge.To("deliveries", Delivery.Type).
- StorageKey(edge.Column("address_id")),
+ StorageKey(edge.Column("delivery_address_id")),
ALTER TABLE "deliveries"
DROP COLUMN "address_id",
ADD COLUMN "delivery_address_id" character varying NOT NULL,
DROP CONSTRAINT "deliveries_addresses_deliveries",
ADD CONSTRAINT "deliveries_addresses_deliveries" FOREIGN KEY ("delivery_address_id") REFERENCES "addresses" ("id") ON DELETE NO ACTION;
from atlas.
Hey @amrnt 👋,
What Ent and Atlas versions do you use? Thanks
from atlas.
latest I think,
ariga.io/atlas v0.4.2-0.20220523090332-08a1147dfc44
entgo.io/contrib v0.2.1-0.20220515130829-06b73685c304
entgo.io/ent v0.10.2-0.20220521203114-1e05ccc28448
I checked other migration when fixed the original issue, the order is just fine. But this for the case where you change the column name.
from atlas.
OK, thanks. I'll give it a look tomorrow morning. For renaming, we plan to add an API to detect such changes (avoid drop and add).
from atlas.
Related Issues (20)
- Declarative workflow breaks on YugabyteDB HOT 6
- Atlas HCL Syntax: String Not Recognized by Linter HOT 5
- [Multi-file schema]: Allow glob pattern for `env.src` HOT 2
- [Multi-file schema / vsCode extension]: Load related schema files into extension context HOT 5
- [vsCode extension]: Do not require schema files to end in `.pg.hcl` HOT 1
- Go 1.23 support with ent schema loader HOT 4
- Possible patch release 0.26.1 HOT 1
- Intermittent errors on Atlas schema inspect SQL Server using docker (Terraform) HOT 5
- `Unknown variable; There is no variable named "PLpgSQL".` when creating Function HOT 4
- `atlas migrate lint` takes very long HOT 1
- Atlas can't revert back data type that already changed HOT 2
- migrate apply fails first apply to CockroachDB v24.2 HOT 1
- Jetbrains IntelliJ Plugin and Code Folding
- The unique index constraint was not updated after adding a new field. HOT 5
- Incorrect migration DDL generated for simple views with `null as` HOT 5
- schema inspect can not parse url correctly with '#' in password HOT 1
- Support implicit names for PG indexes and constraints HOT 3
- Ensure the atlas CLI tool can be installed via the go tools HOT 1
- Schema loading from Prisma
- Planner creates failing ALTER COLUMN for column changing from int to enum HOT 1
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.