-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atlas migrate diff --env sqlalchemy doesn't work #18
Comments
Thanks for reporting this. Atlas should also print the provider stdout when stderr contains unhelpful error like this: |
@ericchansen How does your |
@ronenlu https://github.com/ariga/atlas-provider-sqlalchemy/blob/master/tests/atlas-script.hcl. Please refer to the command in my original issue for how the file is used. |
@ericchansen I run the same commands after starting virtual env and got no error: The migration directory is synced with the desired state, no changes to be made What is the atlas version you are using? |
$ atlas version
atlas community version v0.27.1-8cf2eee-canary
https://github.com/ariga/atlas/releases/latest
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy |
Atlas community is very limited. I agree the error message needs to be better, can you try using the normal build of Atlas: To install:
Further reading: Community vs Other Editions |
data "external_schema" "sqlalchemy" {
program = [
"atlas-provider-sqlalchemy",
"--path", "./app/infra/orm",
"--dialect", "mysql"
]
} the upper is my config. I runed the below and got the error. try it :) atlas-provider-sqlalchemy --path app/infra/orm --dialect mysql
InvalidRequestError: Class <class 'model.FrameworkDeployment'> does not have a __table__ or __tablename__ specified and does not inherit from an existing table-mapped class. in app/infra/orm/model.py
To skip on failed import, run: atlas-provider-sqlalchemy --skip-errors |
@hhk7734 Did you run it from with in the virtual env? |
@hhk7734 how does your |
class FrameworkDeployment(Base):
__tablename__ = "frameworks"
__table_args__ = (
UniqueConstraint("zone", "version", name="uq_zone_version"),
{"mysql_collate": "utf8mb4_general_ci"},
)
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
requester: Mapped[str] = mapped_column(String(length=255))
reason: Mapped[str] = mapped_column(String(length=255))
# ...
build_id: Mapped[int | None] = mapped_column(BigInteger)
build_status: Mapped[schemas.Status] = mapped_column(default=schemas.Status.REQUESTED)
build_requested_at: Mapped[datetime] = mapped_column(default=now)
build_started_at: Mapped[datetime | None]
build_succeeded_at: Mapped[datetime | None]
deploy_id: Mapped[int | None] = mapped_column(BigInteger)
deploy_status: Mapped[schemas.Status | None]
deploy_requested_at: Mapped[datetime | None]
deploy_started_at: Mapped[datetime | None]
deploy_succeeded_at: Mapped[datetime | None]
created_at: Mapped[datetime] = mapped_column(default=now)
updated_at: Mapped[datetime] = mapped_column(default=now, onupdate=now) |
This bug is reproducible without extra code.
The text was updated successfully, but these errors were encountered: