Home » U++ Library support » U++ SQL » Automatic Upgrade MySQL schema
Automatic Upgrade MySQL schema [message #37368] |
Fri, 28 September 2012 04:48  |
|
I discover,that MySQL automatic schema upgrade is not work normally on Mysql server ver 5.5.
I propose this change to Package Sql, file SqlSchema.cpp
(added Rows 25-28)
if(dialect == MSSQL) {
Upgrade() << Expand("alter table @t add ") << cn << ";\n";
Upgrade() << Expand("alter table @t alter column ") << cd << ";\n";
}
else if(dialect == MY_SQL) //Added
Upgrade() << Expand("alter table @t add ") << cn << ";\n"; //Added
Upgrade() << Expand("alter table @t modify ") << cd << ";\n"; //Added
} //Added
else if (dialect == SQLITE3)
Upgrade() << Expand("alter table @t add ") << cd << ";\n";
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: Automatic Upgrade MySQL schema [message #37423 is a reply to message #37418] |
Tue, 02 October 2012 12:25   |
|
This link say, that ALTER COMMAND will have format:
ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);
There is nothing to say that instead of CHANGE (or MODIFY), you can leave just ADD.
pls comment.
PS
In any case, after the addition of the patch on the server MySQL 5.5 all start working.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 14:29:13 CEST 2025
Total time taken to generate the page: 0.03970 seconds
|