Database Collation in project properties

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
MarkBrock
Posts: 33
Joined: Fri 12 Dec 2008 12:31

Database Collation in project properties

Post by MarkBrock » Mon 15 Jun 2009 11:35

if you use the "Import Settings" in the Database tab of your project properties, it will return the wrong collation.
It seems, that it will get the collation_database from the system variables.
But if you have an existing database which uses a different charset and collation than the system defaults, it must be possible to select the one you will use for your database schema if this should be recreated.
If you have set the "Keep original object script", it is not possible to select the collation of your schema.

Is this a bug or deliberately?

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Mon 15 Jun 2009 12:27

Thanks for the report. We will fix the bug with collaction import.
As for the "Keep original object script" option, when it is set, the database objects scripts are generated to the build output without applying database options. In such case the collation option is unnecessary and becomes disabled.

MarkBrock
Posts: 33
Joined: Fri 12 Dec 2008 12:31

Post by MarkBrock » Mon 15 Jun 2009 13:53

That's not really correct. If you set the "Keep original object scripts" and you set "include CREATE DATABASE" in the options for "Generate DDL Wizard" the build script includes an CREATE DATABASE ... statement which then also includes the collation you can see in the "database collation" field, imported from the database.

If the database only exists in your project file, and not on the server, you can get and show the default collation and charset (not available yet) for it, but it always should be selectable. If the database schema exists in the target server, you can get the charset AND the collation from the database.

I think it is a better way to always make the charset and the collation for the database selectable in the project as it is for the tables and the columns.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Tue 16 Jun 2009 08:51

MarkBrock wrote:That's not really correct. If you set the "Keep original object scripts" and you set "include CREATE DATABASE" in the options for "Generate DDL Wizard" the build script includes an CREATE DATABASE ... statement which then also includes the collation you can see in the "database collation" field, imported from the database.
Hello, you are partially right. We will eliminate disabling of database options. But when the "Keep original objects scripts" option is selected, then any object DDL (including database creation) will be included into the project output unmodified.

There is an option "Always re-create database" on the database tab that controls automatical generation of the DROP/CREATE DATABASE statement to the build output. And database options are applied to the CREATE DATABASE statement. It is the better way to use this option than holding CREATE DATABASE statement in the projects scripts.

As for charset, the collation unambiguously determines charset, so charset setting is unnecessary.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Fri 03 Jul 2009 15:46

Hello, we have fixed the bug. Now collation is imported correctly and the option is always avaialble for editing. The fix will be available in the next build soon

Post Reply