Flyway case-sensitive database name - flyway

Is it possible to have a database name as case-sensitive?
For example, in flyway.conf
If I declare a schema as:
flyway.schemas=MySpecialDB
Datebase is then generated as myspecialdb but the desired name is MySpecialDB.
This is observed when using MySQL.

This sound's like your DB is configured to store table names in lower case. Checkout lower_case_table_names in the official MySQL docs for more information.

Related

How to configure Dynamo DB Local's Endpoint Override when using multi-storage with Scalar DB

In order to use multi-storage in Scalar DB, I am implementing it with MySQL and Dynamo DB Local, but the Endpoint Override setting for Dynamo DB Local does not work.
I have configured the following settings, but are they correct?
## Dynamo DB for the transaction tables
scalar.db.multi_storage.storages.dynamo.storage=dynamo
scalar.db.multi_storage.storages.dynamo.contact_points=ap-northeast-1
scalar.db.multi_storage.storages.dynamo.username=fakeMyKeyId
scalar.db.multi_storage.storages.dynamo.password=fakeMyKeyId
scalar.db.multi_storage.storages.dynamo.contact_port=8000
scalar.db.multi_storage.storages.dynamo.endpoint-override=http://localhost:8000
The format of the storage definition in Multi-storage configuration is as follows:
scalar.db.multi_storage.storages.<storage name>.<property name without the prefix 'scalar.db.'>"
For example, if you want to specify the scalar.db.contact_points property for the cassandra storage, you can specify scalar.db.multi_storage.storages.cassandra.contact_points.
In your case, the storage name is dynamo, and you want to specify the scalar.db.dymano.endpoint-override property, so you need to specify scalar.db.multi_storage.storages.dynamo.dynamo.endpoint-override as follows:
scalar.db.multi_storage.storages.dynamo.dynamo.endpoint-override=http://localhost:8000
Please see the following document for the details:
https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md

Spring Security Oauth2 SQL Schema for Postgres?

I intend to use: JdbcTokenStore.
As far as I can tell it uses two tables: oauth_access_token and oauth_refresh_token
I can reverse engineer the table structure; it isn't quite clear if there are references from one table to the other for which I should create a foreign key or not?
Is there a postgres specific schema somewhere? Or another schema that I can refer to?
Batch, for instance, includes the schemas in their dist. I wonder if Oauth2 could do that also?
Many thanks,
Matt
the schema is checked into git as well:
https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql
when using postgres you should use bytea instead of LONGVARBINARY

How do I prevent flyway from creating the schema during init

I'm trying to start using flyway v2.3 on an existing Oracle 11g schema that does not contain the schema_history table
In my flyway.properties i've set the flyway.user to the schema owner and i've set the flyway.schemas property to the same value
When running init from the command line I expected flyway to only create the schema_history table but it fails with this message:
$ ./flyway.cmd init
Flyway (Command-line Tool) v.2.3
Creating schema "myschema" ...
ERROR: Unable to create schema "myschema"
ERROR: Caused by: java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges
Why is flyway attempting to create the schema? I only want it to create the schema_history table in the schema I configured
The command is correct. Please note that flyway.schemas is case-sensitive and automatically filled with the default schema of the user if left empty.
I suspect the value you put in flyway.schemas is in the wrong case. Just leave it empty and you should be ok.
So you have to be sure you want to work on schema which belongs to user name with which you login. If you want to work in different schema you have to specify inside flyway.properties.
I've just had the same problem in Flyway Maven plugin 3.1.
I turned out that I have created my user with lowercase name
CREATE USER myuser ...
And I gave Flyway
flyway.user=myuser
But while connecting my user's name was cast to uppercase, so Flyway reported that user of name MYUSER did not exist.
Solution: Create and use Oracle DB user with uppercase name.

specify default schema for a database in db2 client

Do we have any way to specify default schema in cataloged DBs in db2 client in AIX.
The problem is , when it's connecting to DB, it's taking user ID as default schema and that's where it's failing.
We have too many scripts that are doing transactions to DB without specifying schema in their db2 sql statements. So it's not feasible to change scripts at all.
Also we can't create users to match schema.
You can try to type SET SCHEMA=<your schema> ; before executing your queries.
NOTE: Not sure if this work (I am without a DB2 database at the moment, but it seems that work) and depending on your DB2 version.
You can create a stored procedure that just changes the current schema and then set the SP as connect proc. You can test some conditions before make that schema change, for example if the stored procedure is executed from the AIX server directly with a given user.
You configure the database to use this SP each time a connection is established by modifying connect_proc
http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.config.doc/doc/r0057371.html
http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/c0057372.html
You can create alias in the new user schema that points to the tables with the other schema. Refer these links :
http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0000910.html
http://bytes.com/topic/db2/answers/181247-do-you-have-always-specify-schema-when-using-db2-clp

How to specify schema name in connectionstring in asp.net

How can I specify a schema name in SQL ConnectionString using ASP.net dynamically.
I have a single database with multiple schema. I need to fetch data from table belonging to particular schema.
You can only specify the database and user details in the connection string.
To retrieve data from a specific schema, you need to reference that schema in your query. For example;
SELECT field1, field2 FROM [Schema].[Table]
I would like to reference here an older thread, which is definitely useful in this question:
Possible to set default schema from connection string?
You can only set the default schema to the user itself.
You can try an ALTER USER statement, where you can define a default schema to the user.
It means you can create a user to each schema, if that is what you need.
Each user has their own schema and that is the default schema. Once logged in you can execute:
ALTER SESSION SET CURRENT_SCHEMA = myschema
So you need to execute an extra statement after connecting.

Resources