aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/install/update.php b/install/update.php
index 86731e165..75805513d 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1137 );
+define( 'UPDATE_VERSION' , 1139 );
/**
*
@@ -26,10 +26,14 @@ define( 'UPDATE_VERSION' , 1137 );
* The DB_UPDATE_VERSION will always be one greater than the last numbered script in this file.
*
* If you change the database schema, the following are required:
- * 1. Update the file database.sql to match the new schema.
+ * 1. Update the files schema_mysql.sql and schema_postgres.sql to match the new schema.
+ * Be sure to read doc/sql_conventions.bb ($yoururl/help/sql_conventions) use only standard
+ * SQL data types where possible to keep differences in the files to a minimum
* 2. Update this file by adding a new function at the end with the number of the current DB_UPDATE_VERSION.
* This function should modify the current database schema and perform any other steps necessary
- * to ensure that upgrade is silent and free from requiring interaction.
+ * to ensure that upgrade is silent and free from requiring interaction. Review to ensure that it
+ * will run correctly on both postgres and MySQL/Mariadb. It is very difficult and messy to fix DB update
+ * errors. Once pushed, it requires a new update which undoes any damage and performs the corrected updated.
* 3. Increment the DB_UPDATE_VERSION in boot.php *AND* the UPDATE_VERSION in this file to match it
* 4. TEST the upgrade prior to checkin and filing a pull request.
*
@@ -1568,3 +1572,20 @@ function update_r1136() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1137() {
+ $r1 = q("alter table site add site_valid smallint not null default '0' ");
+ $r2 = q("create index site_valid on site ( site_valid ) ");
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1138() {
+ $r1 = q("alter table outq add outq_priority smallint not null default '0' ");
+ $r2 = q("create index outq_priority on outq ( outq_priority ) ");
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}