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

Error when setting up multi-tenant on shared databases instance #207

Closed
rdagumampan opened this issue May 16, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rdagumampan
Copy link
Owner

Error when setting up multi-tenant on shared databases instance

Deploy postgresql container

docker run -dit --name yuniql-postgresql -e POSTGRES_USER=sa -e POSTGRES_PASSWORD=P@ssw0rd! -e POSTGRES_DB=helloyuniql -p 5432:5432 postgres
yuniql run -a -p C:\play\yuniql\samples\basic-postgresql-sample -c "Host=localhost;Port=5432;Username=sa;Password=P@ssw0rd!;Database=helloyuniql" --transaction-mode version --platform postgresql --debug --meta-schema yuniql --meta-table sales
yuniql list -c "Host=localhost;Port=5432;Username=sa;Password=P@ssw0rd!;Database=helloyuniql" --platform postgresql --debug  --meta-schema yuniql --meta-table sales
yuniql run -a -p C:\play\yuniql\samples\basic-postgresql-sample -c "Host=localhost;Port=5432;Username=sa;Password=P@ssw0rd!;Database=helloyuniql" --transaction-mode version --platform postgresql --debug --meta-schema yuniql --meta-table accounting
yuniql list -c "Host=localhost;Port=5432;Username=sa;Password=P@ssw0rd!;Database=helloyuniql" --platform postgresql --debug  --meta-schema yuniql --meta-table accounting

Exception information

ERR   2021-05-16 13:28:40Z   Failed to execute run function. 42P06: schema "yuniql" already exists
Diagnostics stack trace captured a Npgsql.PostgresException (0x80004005):
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery()
   at Yuniql.Core.ConnectionExtensions.ExecuteNonQuery(IDbConnection connection, String commandText, Nullable`1 commandTimeout, IDbTransaction transaction, ITraceService traceService)
   at Yuniql.Core.MetadataService.CreateSchema(String metaSchemaName, Nullable`1 commandTimeout)
   at Yuniql.Core.MigrationService.Run(String workspace, String targetVersion, Nullable`1 isAutoCreateDatabase, List`1 tokens, Nullable`1 isVerifyOnly, String bulkSeparator, String metaSchemaName, String metaTableName, Nullable`1 commandTimeout, Nullable`1 bulkBatchSize, String appliedByTool, String appliedByToolVersion, String environment, Nullable`1 isContinueAfterFailure, String transactionMode, Boolean isRequiredClearedDraft)
   at Yuniql.Core.MigrationService.Run()
   at Yuniql.CLI.CommandLineService.RunRunOption(RunOption opts)
  Exception data:
    Severity: ERROR
    SqlState: 42P06
    MessageText: schema "yuniql" already exists
    File: pg_namespace.c
    Line: 64
    Routine: NamespaceCreate
If you think this is a bug, please report an issue here https://github.com/rdagumampan/yuniql/issues.
@rdagumampan rdagumampan self-assigned this May 16, 2021
@rdagumampan rdagumampan added the bug Something isn't working label May 16, 2021
@rdagumampan rdagumampan added this to the v1.2 milestone May 16, 2021
@rdagumampan
Copy link
Owner Author

Fixed in v.2 release. Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant