Skip to content
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

Generated PostgreSQL migration file does not contain schema SQL #9372

Open
enylin opened this issue Sep 14, 2022 · 0 comments
Open

Generated PostgreSQL migration file does not contain schema SQL #9372

enylin opened this issue Sep 14, 2022 · 0 comments

Comments

@enylin
Copy link

enylin commented Sep 14, 2022

Issue Description

Generated PostgreSQL migration file does not contain schema creation or deletion SQL.

Expected Behavior

Suppose we have the following entity code,

@Entity({ schema: 'my_schema', name: 'my_name' })

the migration file generated should include something like
CREATE SCHEMA my_schema;
and
DROP SCHEMA my_name;

Actual Behavior

nothing

Steps to Reproduce

  1. Create an entity file
  2. Run node -r ts-node/register ./node_modules/typeorm/cli.js -d data-source.ts migration:generate -n migraion_file
@Entity({ schema: 'my_schema', name: 'my_name' })
export class MyName  {
  // ...
}

My Environment

Dependency Version
Operating System Debian 11
Node.js version v16.17.0
Typescript version 4.8.2
TypeORM version 0.3.9

Additional Context

Relevant Database Driver(s)

DB Type Reproducible
aurora-mysql no
aurora-postgres no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres yes
react-native no
sap no
spanner no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✅ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants