You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Allen Gilliland <Al...@Sun.COM> on 2005/11/04 18:31:22 UTC
Re: svn commit: r330823 -
/incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
Sorry if I am being overly picky, but I do not think this is the right way to apply this database change.
Someone who just runs that script is guaranteed to get an error from one of those 2 statements. I think we need to have a solution that only puts the correct statement in the script for each database.
The method that I used was to do this ...
@ALTER_PUBTIME_ALLOW_NULL@;
and then in each respective db_xxx.properties file you define that variable and put the alter table syntax for that specific database. I am not fond of doing it this way, but in our current system for generating db scripts that's the only way to do it.
personally, I am quickly leaning in favor of maintaining the database scripts for each db separately and ditching the whole "-raw" thing because it's starting to make things confusing. Instead we would just have a directory for each db we support and it would be the responsibility of whoever is using/testing that db to make sure their scripts are up to date for each release. since we only do db upgrade scripts between major releases now I don't think that would be a big deal.
-- Allen
On Fri, 2005-11-04 at 07:09, snoopdave@apache.org wrote:
> Author: snoopdave
> Date: Fri Nov 4 07:09:56 2005
> New Revision: 330823
>
> URL: http://svn.apache.org/viewcvs?rev=330823&view=rev
> Log:
> Added note and MySQL specific alter table syntax
>
> Modified:
> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
>
> Modified: incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
> URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql?rev=330823&r1=330822&r2=330823&view=diff
> ==============================================================================
> --- incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql (original)
> +++ incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql Fri Nov 4 07:09:56 2005
> @@ -1,3 +1,10 @@
>
> --- when using a shared theme, website need not track defauld page id
> +-- Upgrading from 1.2 to 1.3 requires one small change. The website table
> +-- column defaultpageid is now allowed to be null. Unfortunately, MySQL
> +-- requires non-standard alter table syntax for this.
> +
> +-- So if you're on MySQL do this:
> +alter table website modify defaultpageid varchar(48);
> +
> +-- And for all other databases do this:
> alter table website alter column defaultpageid drop not null;
>
>
Re: Yet another Roller 1.3 build (was Re: svn commit: r330823 - /incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
Posted by Anil Gangolli <an...@busybuddha.org>.
You can ignore most of my prior message.
Allen beat me to the punch, but I failed to see his message before I
tested and posted mine which was done with the prior build (what
happened to numbered release candidates?) and pointed out the same problem.
This is a good way to address it for now, and I'm happy that we have.
I still favor using Velocity-expansion for preprocessing in the future...
--a.
Dave Johnson wrote:
>
> On Nov 4, 2005, at 12:31 PM, Allen Gilliland wrote:
>
>> Sorry if I am being overly picky, but I do not think this is the
>> right way to apply this database change.
>
>
> No, you're not being overly picky. I was being overly lazy.
>
>
>> Someone who just runs that script is guaranteed to get an error from
>> one of those 2 statements. I think we need to have a solution that
>> only puts the correct statement in the script for each database.
>>
>> The method that I used was to do this ...
>> @ALTER_PUBTIME_ALLOW_NULL@;
>>
>> and then in each respective db_xxx.properties file you define that
>> variable and put the alter table syntax for that specific database.
>> I am not fond of doing it this way, but in our current system for
>> generating db scripts that's the only way to do it.
>
>
> I just committed changes to trunk and branches/roller_1.x
>
> And I'm upoading a new Roller 1.3 release to ~snoopdave at
> people.apache.org as I write this.
>
> - Dave
>
>
>
>
>>
>> personally, I am quickly leaning in favor of maintaining the
>> database scripts for each db separately and ditching the whole
>> "-raw" thing because it's starting to make things confusing.
>> Instead we would just have a directory for each db we support and it
>> would be the responsibility of whoever is using/testing that db to
>> make sure their scripts are up to date for each release. since we
>> only do db upgrade scripts between major releases now I don't think
>> that would be a big deal.
>>
>> -- Allen
>>
>>
>> On Fri, 2005-11-04 at 07:09, snoopdave@apache.org wrote:
>>
>>> Author: snoopdave
>>> Date: Fri Nov 4 07:09:56 2005
>>> New Revision: 330823
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=330823&view=rev
>>> Log:
>>> Added note and MySQL specific alter table syntax
>>>
>>> Modified:
>>>
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql
>>>
>>> Modified:
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql
>>> URL:
>>> http://svn.apache.org/viewcvs/incubator/roller/branches/roller_1.x/
>>> metadata/database/120-to-130-migration-raw.sql?
>>> rev=330823&r1=330822&r2=330823&view=diff
>>> ======================================================================
>>> ========
>>> ---
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql (original)
>>> +++
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql Fri Nov 4 07:09:56 2005
>>> @@ -1,3 +1,10 @@
>>>
>>> --- when using a shared theme, website need not track defauld page id
>>> +-- Upgrading from 1.2 to 1.3 requires one small change. The
>>> website table
>>> +-- column defaultpageid is now allowed to be null. Unfortunately,
>>> MySQL
>>> +-- requires non-standard alter table syntax for this.
>>> +
>>> +-- So if you're on MySQL do this:
>>> +alter table website modify defaultpageid varchar(48);
>>> +
>>> +-- And for all other databases do this:
>>> alter table website alter column defaultpageid drop not null;
>>>
>>>
>>
>
>
Yet another Roller 1.3 build (was Re: svn commit: r330823 - /incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
Posted by Dave Johnson <da...@rollerweblogger.org>.
On Nov 4, 2005, at 12:31 PM, Allen Gilliland wrote:
> Sorry if I am being overly picky, but I do not think this is the right
> way to apply this database change.
No, you're not being overly picky. I was being overly lazy.
> Someone who just runs that script is guaranteed to get an error from
> one of those 2 statements. I think we need to have a solution that
> only puts the correct statement in the script for each database.
>
> The method that I used was to do this ...
> @ALTER_PUBTIME_ALLOW_NULL@;
>
> and then in each respective db_xxx.properties file you define that
> variable and put the alter table syntax for that specific database. I
> am not fond of doing it this way, but in our current system for
> generating db scripts that's the only way to do it.
I just committed changes to trunk and branches/roller_1.x
And I'm upoading a new Roller 1.3 release to ~snoopdave at
people.apache.org as I write this.
- Dave
>
> personally, I am quickly leaning in favor of maintaining the database
> scripts for each db separately and ditching the whole "-raw" thing
> because it's starting to make things confusing. Instead we would just
> have a directory for each db we support and it would be the
> responsibility of whoever is using/testing that db to make sure their
> scripts are up to date for each release. since we only do db upgrade
> scripts between major releases now I don't think that would be a big
> deal.
>
> -- Allen
>
>
> On Fri, 2005-11-04 at 07:09, snoopdave@apache.org wrote:
>> Author: snoopdave
>> Date: Fri Nov 4 07:09:56 2005
>> New Revision: 330823
>>
>> URL: http://svn.apache.org/viewcvs?rev=330823&view=rev
>> Log:
>> Added note and MySQL specific alter table syntax
>>
>> Modified:
>>
>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>> migration-raw.sql
>>
>> Modified:
>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>> migration-raw.sql
>> URL:
>> http://svn.apache.org/viewcvs/incubator/roller/branches/roller_1.x/
>> metadata/database/120-to-130-migration-raw.sql?
>> rev=330823&r1=330822&r2=330823&view=diff
>> ======================================================================
>> ========
>> ---
>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>> migration-raw.sql (original)
>> +++
>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>> migration-raw.sql Fri Nov 4 07:09:56 2005
>> @@ -1,3 +1,10 @@
>>
>> --- when using a shared theme, website need not track defauld page id
>> +-- Upgrading from 1.2 to 1.3 requires one small change. The website
>> table
>> +-- column defaultpageid is now allowed to be null. Unfortunately,
>> MySQL
>> +-- requires non-standard alter table syntax for this.
>> +
>> +-- So if you're on MySQL do this:
>> +alter table website modify defaultpageid varchar(48);
>> +
>> +-- And for all other databases do this:
>> alter table website alter column defaultpageid drop not null;
>>
>>
>
Re: svn commit: r330823 - /incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
Posted by Dave Johnson <da...@rollerweblogger.org>.
I just committed that as well...
Roller 1.3 file upload underway.
- Dave
On Nov 4, 2005, at 12:41 PM, Allen Gilliland wrote:
> I just tried the script on mysql and the syntax is not quite correct.
> We need to do this ...
>
> alter table website modify defaultpageid varchar(48) DEFAULT '';
>
> -- Allen
>
>
> On Fri, 2005-11-04 at 09:31, Allen Gilliland wrote:
>> Sorry if I am being overly picky, but I do not think this is the
>> right way to apply this database change.
>>
>> Someone who just runs that script is guaranteed to get an error from
>> one of those 2 statements. I think we need to have a solution that
>> only puts the correct statement in the script for each database.
>>
>> The method that I used was to do this ...
>>
>> @ALTER_PUBTIME_ALLOW_NULL@;
>>
>> and then in each respective db_xxx.properties file you define that
>> variable and put the alter table syntax for that specific database.
>> I am not fond of doing it this way, but in our current system for
>> generating db scripts that's the only way to do it.
>>
>> personally, I am quickly leaning in favor of maintaining the database
>> scripts for each db separately and ditching the whole "-raw" thing
>> because it's starting to make things confusing. Instead we would
>> just have a directory for each db we support and it would be the
>> responsibility of whoever is using/testing that db to make sure their
>> scripts are up to date for each release. since we only do db upgrade
>> scripts between major releases now I don't think that would be a big
>> deal.
>>
>> -- Allen
>>
>>
>> On Fri, 2005-11-04 at 07:09, snoopdave@apache.org wrote:
>>> Author: snoopdave
>>> Date: Fri Nov 4 07:09:56 2005
>>> New Revision: 330823
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=330823&view=rev
>>> Log:
>>> Added note and MySQL specific alter table syntax
>>>
>>> Modified:
>>>
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql
>>>
>>> Modified:
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql
>>> URL:
>>> http://svn.apache.org/viewcvs/incubator/roller/branches/roller_1.x/
>>> metadata/database/120-to-130-migration-raw.sql?
>>> rev=330823&r1=330822&r2=330823&view=diff
>>> =====================================================================
>>> =========
>>> ---
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql (original)
>>> +++
>>> incubator/roller/branches/roller_1.x/metadata/database/120-to-130-
>>> migration-raw.sql Fri Nov 4 07:09:56 2005
>>> @@ -1,3 +1,10 @@
>>>
>>> --- when using a shared theme, website need not track defauld page id
>>> +-- Upgrading from 1.2 to 1.3 requires one small change. The website
>>> table
>>> +-- column defaultpageid is now allowed to be null. Unfortunately,
>>> MySQL
>>> +-- requires non-standard alter table syntax for this.
>>> +
>>> +-- So if you're on MySQL do this:
>>> +alter table website modify defaultpageid varchar(48);
>>> +
>>> +-- And for all other databases do this:
>>> alter table website alter column defaultpageid drop not null;
>>>
>>>
>>
>
Re: svn commit: r330823 -
/incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
Posted by Allen Gilliland <Al...@Sun.COM>.
I just tried the script on mysql and the syntax is not quite correct. We need to do this ...
alter table website modify defaultpageid varchar(48) DEFAULT '';
-- Allen
On Fri, 2005-11-04 at 09:31, Allen Gilliland wrote:
> Sorry if I am being overly picky, but I do not think this is the right way to apply this database change.
>
> Someone who just runs that script is guaranteed to get an error from one of those 2 statements. I think we need to have a solution that only puts the correct statement in the script for each database.
>
> The method that I used was to do this ...
>
> @ALTER_PUBTIME_ALLOW_NULL@;
>
> and then in each respective db_xxx.properties file you define that variable and put the alter table syntax for that specific database. I am not fond of doing it this way, but in our current system for generating db scripts that's the only way to do it.
>
> personally, I am quickly leaning in favor of maintaining the database scripts for each db separately and ditching the whole "-raw" thing because it's starting to make things confusing. Instead we would just have a directory for each db we support and it would be the responsibility of whoever is using/testing that db to make sure their scripts are up to date for each release. since we only do db upgrade scripts between major releases now I don't think that would be a big deal.
>
> -- Allen
>
>
> On Fri, 2005-11-04 at 07:09, snoopdave@apache.org wrote:
> > Author: snoopdave
> > Date: Fri Nov 4 07:09:56 2005
> > New Revision: 330823
> >
> > URL: http://svn.apache.org/viewcvs?rev=330823&view=rev
> > Log:
> > Added note and MySQL specific alter table syntax
> >
> > Modified:
> > incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
> >
> > Modified: incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql
> > URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql?rev=330823&r1=330822&r2=330823&view=diff
> > ==============================================================================
> > --- incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql (original)
> > +++ incubator/roller/branches/roller_1.x/metadata/database/120-to-130-migration-raw.sql Fri Nov 4 07:09:56 2005
> > @@ -1,3 +1,10 @@
> >
> > --- when using a shared theme, website need not track defauld page id
> > +-- Upgrading from 1.2 to 1.3 requires one small change. The website table
> > +-- column defaultpageid is now allowed to be null. Unfortunately, MySQL
> > +-- requires non-standard alter table syntax for this.
> > +
> > +-- So if you're on MySQL do this:
> > +alter table website modify defaultpageid varchar(48);
> > +
> > +-- And for all other databases do this:
> > alter table website alter column defaultpageid drop not null;
> >
> >
>