You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2011/11/02 22:27:47 UTC

svn commit: r1196807 - in /incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2: ./ mysql.sql

Author: scottbw
Date: Wed Nov  2 21:27:47 2011
New Revision: 1196807

URL: http://svn.apache.org/viewvc?rev=1196807&view=rev
Log:
Added a migration script to create the oAuth tokens table when upgrading.

Added:
    incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/
    incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/mysql.sql

Added: incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/mysql.sql
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/mysql.sql?rev=1196807&view=auto
==============================================================================
--- incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/mysql.sql (added)
+++ incubator/wookie/trunk/scripts/migration/0.9.1-to-0.9.2/mysql.sql Wed Nov  2 21:27:47 2011
@@ -0,0 +1,41 @@
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# MySQL5 database migration script for Apache Wookie (incubating) 0.9.2
+#
+# This script updates a database created with version 0.9.1 of Wookie
+# to work with version 0.9.2. Always use a clone of your database and not the 
+# live version when performing migration.
+#
+
+# ----------------------------------------------------------------------- 
+# New oAuth Token table
+# 
+# ----------------------------------------------------------------------- 
+CREATE TABLE OAuthToken
+ (
+     id INTEGER NOT NULL,
+     jpa_version INTEGER,
+     authzUrl VARCHAR(255) NOT NULL,
+     accessToken VARCHAR(255) NOT NULL,
+     clientId VARCHAR(255) NOT NULL,
+     expires BIGINT NOT NULL,
+     widget_instance_id INTEGER,
+     PRIMARY KEY (id)
+ ) ;
+ 
+CREATE INDEX IXOAuthToken1 ON OAuthToken (widget_instance_id);
+ 
+ALTER TABLE OAuthToken ADD CONSTRAINT FKOAuthToken1 FOREIGN KEY (widget_instance_id) REFERENCES WidgetInstance (id);
\ No newline at end of file