diff options
author | David Rousselie <dax@happycoders.org> | 2008-05-30 23:49:11 +0400 |
---|---|---|
committer | David Rousselie <dax@happycoders.org> | 2008-05-30 23:49:11 +0400 |
commit | 2c5fe4ca4416a286666365e6ff87ad7349d7816f (patch) | |
tree | 00e5d6f29616f346e0feb7bce05deb6f2646c845 | |
parent | 340179bc5472de2b95c711930a5fc40053fcfb50 (diff) |
Add database upgrade script
darcs-hash:20080530194911-86b55-0bb61c0a8e9a22b75e978a3b90f5161b83a6042b.gz
-rw-r--r-- | sqlobject_history/2007-12-04/upgrade_sqlite_2008-05-29.sql | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/sqlobject_history/2007-12-04/upgrade_sqlite_2008-05-29.sql b/sqlobject_history/2007-12-04/upgrade_sqlite_2008-05-29.sql new file mode 100644 index 0000000..e7ef461 --- /dev/null +++ b/sqlobject_history/2007-12-04/upgrade_sqlite_2008-05-29.sql @@ -0,0 +1,66 @@ +-- Class jmc.model.account.AbstractSMTPAccount +-- Database: sqlite +CREATE TABLE abstract_smtp_account ( + id INTEGER PRIMARY KEY, + default_from TEXT, + default_account TINYINT, + child_name VARCHAR(255) +); + +-- Class jmc.model.account.GlobalSMTPAccount +-- Database: sqlite +CREATE TABLE global_smtp_account ( + id INTEGER PRIMARY KEY, + login TEXT, + password TEXT, + host TEXT, + port INT, + tls TINYINT, + store_password TINYINT, + waiting_password_reply TINYINT, + child_name VARCHAR(255) +); + +INSERT INTO abstract_smtp_account + SELECT + id, + default_from, + default_account, + "GlobalSMTPAccount" + FROM + smtp_account; + +INSERT INTO global_smtp_account + SELECT + id, + login, + password, + host, + port, + tls, + store_password, + waiting_password_reply, + "SMTPAccount" + FROM + smtp_account; + +DROP TABLE smtp_account; + +-- Class jmc.model.account.SMTPAccount +-- Database: sqlite +CREATE TABLE smtp_account ( + id INTEGER PRIMARY KEY, + child_name VARCHAR(255) +); + +INSERT INTO smtp_account + SELECT + id, + NULL + FROM + global_smtp_account; + +UPDATE account SET + child_name="AbstractSMTPAccount" +WHERE + child_name="SMTPAccount"; |