FriendsStore.migrations 510 B

12345678910111213141516171819202122
  1. :VERSION 1
  2. BEGIN TRANSACTION
  3. CREATE TABLE [Friends] (
  4. [PrincipalID] uniqueidentifier NOT NULL,
  5. [Friend] varchar(255) NOT NULL,
  6. [Flags] char(16) NOT NULL DEFAULT '0',
  7. [Offered] varchar(32) NOT NULL DEFAULT 0)
  8. ON [PRIMARY]
  9. COMMIT
  10. :VERSION 2
  11. BEGIN TRANSACTION
  12. IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[userfriends]') AND type in (N'U'))
  13. INSERT INTO Friends (PrincipalID, Friend, Flags, Offered)
  14. SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends;
  15. COMMIT