Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Creating table 'LotteryUser'
- CREATE TABLE [dbo].[LotteryUser] (
- [Id] bigint IDENTITY(1,1) NOT NULL,
- [UserId] bigint NOT NULL,
- [TenantId] bigint NOT NULL,
- [ContentId] bigint NOT NULL,
- [Uid] nvarchar(36) NOT NULL,
- [IsWinner] bit NOT NULL DEFAULT ((0)),
- [Created] datetime NOT NULL DEFAULT (getdate()),
- [ContentType] nvarchar(255) NOT NULL DEFAULT (N'Lottery')
- );
- GO
- -- Creating primary key on [Id] in table 'LotteryUser'
- ALTER TABLE [dbo].[LotteryUser]
- ADD CONSTRAINT [PK_LotteryUser]
- PRIMARY KEY CLUSTERED ([Id] ASC);
- GO
- -- Creating foreign key on [ContentId] in table 'LotteryUser'
- ALTER TABLE [dbo].[LotteryUser]
- ADD CONSTRAINT [FK_LotteryUser_Content]
- FOREIGN KEY ([ContentId])
- REFERENCES [dbo].[Content]
- ([Id])
- ON DELETE CASCADE ON UPDATE NO ACTION;
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement