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

Add option to change schema name #39

Open
alfredosilvestre-natixis opened this issue Dec 15, 2022 · 0 comments
Open

Add option to change schema name #39

alfredosilvestre-natixis opened this issue Dec 15, 2022 · 0 comments

Comments

@alfredosilvestre-natixis

Since in Postgres a database contains one or more named schemas and in MySQL schema=database, when converting from Postgres, add an option to set the database name for MySQL.

In our case, we have a database named "testdb" and the schema named "public", but in MySQL we only have the schema "testdb", however in the converted file it will keep the Postgres schema name.

Right now we are using sed to replace:

sed -i -e 's/\s${POSTGRES_SCHEMA};/ ${MYSQL_DB};/gi' "${MYSQL_DUMP}.sql"
sed -i -e 's/\s${POSTGRES_SCHEMA}\./ ${MYSQL_DB}\./gi' "${MYSQL_DUMP}.sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant