Skip to content

Commit

Permalink
Merge pull request #107 from ncharles/bug_3883/int/migration_script_f…
Browse files Browse the repository at this point in the history
…or_user_name_length

Bug 3883/int/migration script for user name length
  • Loading branch information
jooooooon committed Aug 29, 2013
2 parents d06999e + 29cf370 commit 5654241
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rudder-webapp/SOURCES/rudder-upgrade
Expand Up @@ -60,6 +60,7 @@ set -e
# - 2.4.0 : Disable base.url attribute in rudder-web.properties
# - 2.4.0 : Update logback.xml in order to have information about name historization
# - 2.4.1 : Add the group serialization table (GroupsNodesJoin) to the database
# - 2.4.8 : Remove the user name length limitation in the event log table
#####################################################################################

# Some variables
Expand Down Expand Up @@ -597,5 +598,11 @@ if [ $RES -eq 0 ]; then
psql -q -U rudder -h localhost -d rudder -f ${RUDDER_UPGRADE_TOOLS}/dbMigration-2.4-2.5-group-serialisation.sql > /dev/null
fi

# - 2.4.8: Remove the user name length limitation in the event log table
RES=$(su - postgres -c "psql -d rudder -t -c \"select count(*) from INFORMATION_SCHEMA.COLUMNS where column_name='principal' and table_name = 'eventlog' and data_type = 'character varying'\"")
if [ $RES -ne 0 ]; then
psql -q -U rudder -h localhost -d rudder -f ${RUDDER_UPGRADE_TOOLS}/dbMigration-2.4-2.4-eventlog-unlimited-principal-length.sql > /dev/null
fi

# For every upgrade, we force the root server to run a new inventory on the next CFEngine run
touch /opt/rudder/etc/force_inventory
1 change: 1 addition & 0 deletions rudder-webapp/SPECS/rudder-webapp.spec
Expand Up @@ -167,6 +167,7 @@ cp %{_sourcedir}/rudder-sources/rudder/rudder-core/src/main/resources/Migration/
cp %{_sourcedir}/rudder-sources/rudder/rudder-core/src/main/resources/Migration/dbMigration-2.3-2.4-archive.sql %{buildroot}%{rudderdir}/share/upgrade-tools/
cp %{_sourcedir}/rudder-sources/rudder/rudder-core/src/main/resources/Migration/dbMigration-2.3-2.4-index-archive.sql %{buildroot}%{rudderdir}/share/upgrade-tools/
cp %{_sourcedir}/rudder-sources/rudder/rudder-core/src/main/resources/Migration/dbMigration-2.4-2.5-group-serialisation.sql %{buildroot}%{rudderdir}/share/upgrade-tools/
cp %{_sourcedir}/rudder-sources/rudder/rudder-core/src/main/resources/Migration/dbMigration-2.4-2.4-eventlog-unlimited-principal-length.sql %{buildroot}%{rudderdir}/share/upgrade-tools/
cp %{_sourcedir}/rudder-upgrade-LDAP-schema-2.3-2.4-add-entries.ldif %{buildroot}%{rudderdir}/share/upgrade-tools/
cp %{_sourcedir}/rudder-upgrade-LDAP-schema-2.3-2.4-add-archives-entry.ldif %{buildroot}%{rudderdir}/share/upgrade-tools/

Expand Down
2 changes: 2 additions & 0 deletions rudder-webapp/debian/rules
Expand Up @@ -94,6 +94,8 @@ binary-arch: install
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/rudder-sources/rudder/rudder-core/src/main/resources/Migration/ dbMigration-2.3-2.4-archive.sql /opt/rudder/share/upgrade-tools/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/rudder-sources/rudder/rudder-core/src/main/resources/Migration/ dbMigration-2.3-2.4-index-archive.sql /opt/rudder/share/upgrade-tools/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/rudder-sources/rudder/rudder-core/src/main/resources/Migration/ dbMigration-2.4-2.5-group-serialisation.sql /opt/rudder/share/upgrade-tools/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/rudder-sources/rudder/rudder-core/src/main/resources/Migration/ dbMigration-2.4-2.4-eventlog-unlimited-principal-length.sql /opt/rudder/share/upgrade-tools/

dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-upgrade-LDAP-schema-2.3-2.4-add-entries.ldif /opt/rudder/share/upgrade-tools/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-upgrade-LDAP-schema-2.3-2.4-add-archives-entry.ldif /opt/rudder/share/upgrade-tools/

Expand Down

0 comments on commit 5654241

Please sign in to comment.