aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-02-14 18:17:54 +0100
committerFabrice Bellingard <bellingard@gmail.com>2012-02-14 18:18:42 +0100
commit024166d58faf575747198a84e47b30e1e8c9d311 (patch)
treef486986e60ea392465becad189afba1b96154e26 /sonar-server
parent2e2ab3f8e9aa4c4b029b1cde04ef8528e8151753 (diff)
downloadsonarqube-024166d58faf575747198a84e47b30e1e8c9d311.tar.gz
sonarqube-024166d58faf575747198a84e47b30e1e8c9d311.zip
Document best practices for DB migration scripts
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt b/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt
index e22d74cd5d7..a5a7e8fcd91 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt
@@ -14,3 +14,10 @@ RECOMMANDATIONS
* Don't forget that index name limited to 30 characters in Oracle DB.
* Prefer to add nullable columns to avoid problems during migration.
+* When adding index, do not forget to name the index (so that it is possible later to delete it)
+ + Example:
+ add_index "action_plans", "project_id", :name => "ap_project_id"
+* When modifying columns in a table, do not forget to reset the column information on the Ruby model if you use it
+ + Example:
+ add_column 'users', 'active', :boolean, :null => true, :default => true
+ User.reset_column_information