1
0

FriendsStore.migrations 752 B

1234567891011121314151617181920212223242526272829303132
  1. :VERSION 1 # -------------------------
  2. BEGIN;
  3. CREATE TABLE `Friends` (
  4. `PrincipalID` CHAR(36) NOT NULL,
  5. `Friend` VARCHAR(255) NOT NULL,
  6. `Flags` VARCHAR(16) NOT NULL DEFAULT 0,
  7. `Offered` VARCHAR(32) NOT NULL DEFAULT 0,
  8. PRIMARY KEY(`PrincipalID`, `Friend`),
  9. KEY(`PrincipalID`)
  10. );
  11. COMMIT;
  12. :VERSION 2 # -------------------------
  13. BEGIN;
  14. INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userfriends`;
  15. COMMIT;
  16. :VERSION 3 # -------------------------
  17. BEGIN;
  18. ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
  19. ALTER TABLE `Friends` DROP PRIMARY KEY;
  20. ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36));
  21. COMMIT;