-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release/0.5
- Loading branch information
Showing
7 changed files
with
107 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,54 @@ | ||
alter table `batches` change column `user_id` `userid` int(11) not null; | ||
alter table `batches` change column `collection_id` `collection` int(11) not null; | ||
alter table `bso` change column `user_id` `userid` int(11) not null; | ||
alter table `bso` change column `collection_id` `collection` int(11) not null; | ||
alter table `bso` change column `expiry` `ttl` bigint(20) not null; | ||
alter table `user_collections` change column `user_id` `userid` int(11) not null; | ||
alter table `user_collections` change column `collection_id` `collection` int(11) not null; | ||
alter table `user_collections` change column `modified` `last_modified` bigint(20) not null; | ||
-- must be last in case of error | ||
-- the following column is not used, but preserved for legacy and stand alone systems. | ||
alter table `bso` add column `payload_size` int(11) default 0; | ||
-- tests to see if columns need adjustment | ||
-- this is because the `init` may create the tables | ||
-- with column names already correct | ||
|
||
CREATE PROCEDURE UPDATE_165600() | ||
BEGIN | ||
IF EXISTS( SELECT column_name | ||
FROM INFORMATION_SCHEMA.COLUMNS | ||
WHERE table_name='bso' AND column_name="user_id") | ||
THEN | ||
BEGIN | ||
alter table `bso` change column `user_id` `userid` int(11) not null; | ||
alter table `bso` change column `collection_id` `collection` int(11) not null; | ||
alter table `bso` change column `expiry` `ttl` bigint(20) not null; | ||
END; | ||
END IF; | ||
|
||
IF EXISTS( SELECT column_name | ||
FROM INFORMATION_SCHEMA.COLUMNS | ||
WHERE table_name='batches' AND column_name="user_id") | ||
THEN | ||
BEGIN | ||
alter table `batches` change column `user_id` `userid` int(11) not null; | ||
alter table `batches` change column `collection_id` `collection` int(11) not null; | ||
END; | ||
END IF; | ||
|
||
IF EXISTS( SELECT column_name | ||
FROM INFORMATION_SCHEMA.COLUMNS | ||
WHERE table_name='user_collections' AND column_name="user_id") | ||
THEN | ||
BEGIN | ||
alter table `user_collections` change column `user_id` `userid` int(11) not null; | ||
alter table `user_collections` change column `collection_id` `collection` int(11) not null; | ||
alter table `user_collections` change column `modified` `last_modified` bigint(20) not null; | ||
END; | ||
END IF; | ||
|
||
-- must be last in case of error | ||
-- the following column is not used, but preserved for legacy and stand alone systems. | ||
IF NOT EXISTS( SELECT column_name | ||
FROM INFORMATION_SCHEMA.COLUMNS | ||
where table_name='bso' AND column_name="payload_size") | ||
THEN | ||
BEGIN | ||
alter table `bso` add column `payload_size` int(11) default 0; | ||
END; | ||
|
||
END IF; | ||
END; | ||
|
||
CALL UPDATE_165600(); | ||
|
||
DROP PROCEDURE UPDATE_165600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
-- Your SQL goes here | ||
alter table `batches` change column `userid` `userid` bigint(20) not null; | ||
alter table `bso` change column `userid` `userid` bigint(20) not null; | ||
alter table `user_collections` change column `userid` `userid` bigint(20) not null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters