Advertisement
Yevrag35

Untitled

Jan 14th, 2024
1,525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 27.50 KB | Source Code | 0 0
  1. USE [Omni_TEMP]
  2. GO
  3. /****** Object:  Table [dbo].[AL_ShipGirls]    Script Date: 1/14/2024 10:19:49 AM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE TABLE [dbo].[AL_ShipGirls](
  9.     [ShipGirlId] [int] IDENTITY(1,1) NOT NULL,
  10.     [WikiId] [int] NOT NULL,
  11.     [CharacterId] [int] NULL,
  12.     [AniCharid] [bigint] NULL,
  13.     [ShipGirlName] [nvarchar](max) NOT NULL,
  14.     [AntiAir] [int] NOT NULL,
  15.     [Aviation] [int] NOT NULL,
  16.     [Evasion] [int] NOT NULL,
  17.     [Faction] [nvarchar](max) NOT NULL,
  18.     [Firepower] [int] NOT NULL,
  19.     [Health] [int] NOT NULL,
  20.     [GameRarity] [nvarchar](max) NOT NULL,
  21.     [Torpedo] [int] NOT NULL,
  22.     [Type] [nvarchar](max) NOT NULL,
  23.  CONSTRAINT [PK_AL_ShipGirls] PRIMARY KEY CLUSTERED
  24. (
  25.     [ShipGirlId] ASC
  26. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY],
  27.  CONSTRAINT [IX_AL_ShipGirls] UNIQUE NONCLUSTERED
  28. (
  29.     [WikiId] ASC
  30. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  31. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  32. GO
  33. /****** Object:  Table [dbo].[APIAccess]    Script Date: 1/14/2024 10:19:49 AM ******/
  34. SET ANSI_NULLS ON
  35. GO
  36. SET QUOTED_IDENTIFIER ON
  37. GO
  38. CREATE TABLE [dbo].[APIAccess](
  39.     [Id] [int] IDENTITY(1,1) NOT NULL,
  40.     [UserId] [int] NOT NULL,
  41.     [IsAdmin] [bit] NOT NULL,
  42.     [IsSir] [bit] NOT NULL,
  43.     [KeyHash] [nvarchar](max) NOT NULL,
  44.  CONSTRAINT [PK_APIAccess] PRIMARY KEY CLUSTERED
  45. (
  46.     [Id] ASC
  47. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  48. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  49. GO
  50. /****** Object:  Table [dbo].[Buddies]    Script Date: 1/14/2024 10:19:49 AM ******/
  51. SET ANSI_NULLS ON
  52. GO
  53. SET QUOTED_IDENTIFIER ON
  54. GO
  55. CREATE TABLE [dbo].[Buddies](
  56.     [StatId] [int] NOT NULL,
  57.     [BuddyStatId] [int] NOT NULL,
  58.     [IsNegative] [bit] NOT NULL
  59. ) ON [PRIMARY]
  60. GO
  61. /****** Object:  Table [dbo].[Characters]    Script Date: 1/14/2024 10:19:49 AM ******/
  62. SET ANSI_NULLS ON
  63. GO
  64. SET QUOTED_IDENTIFIER ON
  65. GO
  66. CREATE TABLE [dbo].[Characters](
  67.     [Id] [int] IDENTITY(1,1) NOT NULL,
  68.     [Name] [nvarchar](max) NOT NULL,
  69.     [ImageUrl] [nvarchar](max) NOT NULL,
  70.     [SourceId] [int] NOT NULL,
  71.     [AniCharId] [bigint] NOT NULL,
  72.     [DibbedById] [int] NOT NULL,
  73.     [IsCustom] [bit] NOT NULL,
  74.     [IsLocked] [bit] NOT NULL,
  75.     [IsNoWeekly] [bit] NULL,
  76.  CONSTRAINT [PK_Characters] PRIMARY KEY CLUSTERED
  77. (
  78.     [Id] ASC
  79. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  80. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  81. GO
  82. /****** Object:  Table [dbo].[CharacterTags]    Script Date: 1/14/2024 10:19:49 AM ******/
  83. SET ANSI_NULLS ON
  84. GO
  85. SET QUOTED_IDENTIFIER ON
  86. GO
  87. CREATE TABLE [dbo].[CharacterTags](
  88.     [CharacterId] [int] NOT NULL,
  89.     [TagId] [bigint] NOT NULL
  90. ) ON [PRIMARY]
  91. GO
  92. /****** Object:  Table [dbo].[DotD]    Script Date: 1/14/2024 10:19:49 AM ******/
  93. SET ANSI_NULLS ON
  94. GO
  95. SET QUOTED_IDENTIFIER ON
  96. GO
  97. CREATE TABLE [dbo].[DotD](
  98.     [Id] [int] IDENTITY(1,1) NOT NULL,
  99.     [CharacterId] [int] NOT NULL,
  100.     [Date] [date] NOT NULL,
  101.     [UserId] [int] NOT NULL,
  102.  CONSTRAINT [PK_DotD] PRIMARY KEY CLUSTERED
  103. (
  104.     [Id] ASC
  105. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  106. ) ON [PRIMARY]
  107. GO
  108. /****** Object:  Table [dbo].[ElementMatchups]    Script Date: 1/14/2024 10:19:49 AM ******/
  109. SET ANSI_NULLS ON
  110. GO
  111. SET QUOTED_IDENTIFIER ON
  112. GO
  113. CREATE TABLE [dbo].[ElementMatchups](
  114.     [AttackingId] [int] NOT NULL,
  115.     [DefendingId] [int] NOT NULL,
  116.     [NetEffect] [int] NOT NULL,
  117.     [IsImmunity] [bit] NOT NULL
  118. ) ON [PRIMARY]
  119. GO
  120. /****** Object:  Table [dbo].[Elements]    Script Date: 1/14/2024 10:19:49 AM ******/
  121. SET ANSI_NULLS ON
  122. GO
  123. SET QUOTED_IDENTIFIER ON
  124. GO
  125. CREATE TABLE [dbo].[Elements](
  126.     [ElementId] [int] IDENTITY(1,1) NOT NULL,
  127.     [ElementName] [nvarchar](max) NOT NULL,
  128.     [IsDefault] [bit] NOT NULL,
  129.  CONSTRAINT [PK_Elements] PRIMARY KEY CLUSTERED
  130. (
  131.     [ElementId] ASC
  132. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  133. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  134. GO
  135. /****** Object:  Table [dbo].[FactionMembership]    Script Date: 1/14/2024 10:19:49 AM ******/
  136. SET ANSI_NULLS ON
  137. GO
  138. SET QUOTED_IDENTIFIER ON
  139. GO
  140. CREATE TABLE [dbo].[FactionMembership](
  141.     [CharacterId] [int] NOT NULL,
  142.     [FactionId] [int] NOT NULL
  143. ) ON [PRIMARY]
  144. GO
  145. /****** Object:  Table [dbo].[Factions]    Script Date: 1/14/2024 10:19:49 AM ******/
  146. SET ANSI_NULLS ON
  147. GO
  148. SET QUOTED_IDENTIFIER ON
  149. GO
  150. CREATE TABLE [dbo].[Factions](
  151.     [FactionId] [int] IDENTITY(1,1) NOT NULL,
  152.     [FactionName] [nvarchar](max) NOT NULL,
  153.     [M_HeadId] [int] NOT NULL,
  154.     [PrimaryElementId] [int] NOT NULL,
  155.     [F_HeadId] [int] NOT NULL,
  156.     [SecondaryElementId] [int] NULL,
  157.  CONSTRAINT [PK_Factions] PRIMARY KEY CLUSTERED
  158. (
  159.     [FactionId] ASC
  160. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  161. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  162. GO
  163. /****** Object:  Table [dbo].[FoxDay]    Script Date: 1/14/2024 10:19:49 AM ******/
  164. SET ANSI_NULLS ON
  165. GO
  166. SET QUOTED_IDENTIFIER ON
  167. GO
  168. CREATE TABLE [dbo].[FoxDay](
  169.     [DotDId] [int] NOT NULL,
  170.     [OccurredOn] [date] NOT NULL
  171. ) ON [PRIMARY]
  172. GO
  173. /****** Object:  Table [dbo].[Franchises]    Script Date: 1/14/2024 10:19:49 AM ******/
  174. SET ANSI_NULLS ON
  175. GO
  176. SET QUOTED_IDENTIFIER ON
  177. GO
  178. CREATE TABLE [dbo].[Franchises](
  179.     [FranchiseId] [int] IDENTITY(1,1) NOT NULL,
  180.     [FranchiseName] [nvarchar](max) NOT NULL,
  181.  CONSTRAINT [PK_Franchises] PRIMARY KEY CLUSTERED
  182. (
  183.     [FranchiseId] ASC
  184. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  185. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  186. GO
  187. /****** Object:  Table [dbo].[Ideas]    Script Date: 1/14/2024 10:19:49 AM ******/
  188. SET ANSI_NULLS ON
  189. GO
  190. SET QUOTED_IDENTIFIER ON
  191. GO
  192. CREATE TABLE [dbo].[Ideas](
  193.     [Id] [int] IDENTITY(1,1) NOT NULL,
  194.     [Name] [nvarchar](max) NOT NULL,
  195.     [CreatedById] [int] NOT NULL,
  196.     [Text] [nvarchar](max) NOT NULL,
  197.     [IsCompleted] [bit] NOT NULL,
  198.     [CreatedOn] [datetime] NOT NULL,
  199.     [ModifiedOn] [datetime] NOT NULL,
  200.     [Priority] [int] NOT NULL,
  201.  CONSTRAINT [PK_Ideas] PRIMARY KEY CLUSTERED
  202. (
  203.     [Id] ASC
  204. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  205. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  206. GO
  207. /****** Object:  Table [dbo].[ImageRelationships]    Script Date: 1/14/2024 10:19:49 AM ******/
  208. SET ANSI_NULLS ON
  209. GO
  210. SET QUOTED_IDENTIFIER ON
  211. GO
  212. CREATE TABLE [dbo].[ImageRelationships](
  213.     [ImageId] [int] NOT NULL,
  214.     [CharacterId] [int] NOT NULL,
  215.     [ImageType] [int] NOT NULL
  216. ) ON [PRIMARY]
  217. GO
  218. /****** Object:  Table [dbo].[Images]    Script Date: 1/14/2024 10:19:49 AM ******/
  219. SET ANSI_NULLS ON
  220. GO
  221. SET QUOTED_IDENTIFIER ON
  222. GO
  223. CREATE TABLE [dbo].[Images](
  224.     [Id] [int] IDENTITY(1,1) NOT NULL,
  225.     [Slug] [nvarchar](max) NOT NULL,
  226.     [UploadedById] [int] NOT NULL,
  227.     [UploadedUtc] [datetime] NOT NULL,
  228.  CONSTRAINT [PK_Images] PRIMARY KEY CLUSTERED
  229. (
  230.     [Id] ASC
  231. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  232. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  233. GO
  234. /****** Object:  Table [dbo].[ImageTags]    Script Date: 1/14/2024 10:19:49 AM ******/
  235. SET ANSI_NULLS ON
  236. GO
  237. SET QUOTED_IDENTIFIER ON
  238. GO
  239. CREATE TABLE [dbo].[ImageTags](
  240.     [ImageId] [int] NOT NULL,
  241.     [TagId] [bigint] NOT NULL
  242. ) ON [PRIMARY]
  243. GO
  244. /****** Object:  Table [dbo].[Rarities]    Script Date: 1/14/2024 10:19:49 AM ******/
  245. SET ANSI_NULLS ON
  246. GO
  247. SET QUOTED_IDENTIFIER ON
  248. GO
  249. CREATE TABLE [dbo].[Rarities](
  250.     [Id] [int] IDENTITY(1,1) NOT NULL,
  251.     [Name] [nvarchar](max) NOT NULL,
  252.     [Probability] [int] NOT NULL,
  253.     [Rank] [int] NOT NULL,
  254.  CONSTRAINT [PK_Rarities] PRIMARY KEY CLUSTERED
  255. (
  256.     [Id] ASC
  257. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  258. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  259. GO
  260. /****** Object:  Table [dbo].[Reminders]    Script Date: 1/14/2024 10:19:49 AM ******/
  261. SET ANSI_NULLS ON
  262. GO
  263. SET QUOTED_IDENTIFIER ON
  264. GO
  265. CREATE TABLE [dbo].[Reminders](
  266.     [Id] [int] IDENTITY(1,1) NOT NULL,
  267.     [ReminderId] [uniqueidentifier] NOT NULL,
  268.     [UserId] [int] NOT NULL,
  269.     [ChannelId] [nvarchar](max) NOT NULL,
  270.     [Scheduled] [datetime] NOT NULL,
  271.     [Message] [nvarchar](max) NULL,
  272.  CONSTRAINT [PK_Reminders] PRIMARY KEY CLUSTERED
  273. (
  274.     [Id] ASC
  275. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  276. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  277. GO
  278. /****** Object:  Table [dbo].[RerollStats]    Script Date: 1/14/2024 10:19:49 AM ******/
  279. SET ANSI_NULLS ON
  280. GO
  281. SET QUOTED_IDENTIFIER ON
  282. GO
  283. CREATE TABLE [dbo].[RerollStats](
  284.     [Id] [int] IDENTITY(1,1) NOT NULL,
  285.     [UserId] [int] NOT NULL,
  286.     [RerollCount] [int] NOT NULL,
  287.  CONSTRAINT [PK_RerollStats] PRIMARY KEY CLUSTERED
  288. (
  289.     [Id] ASC
  290. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  291. ) ON [PRIMARY]
  292. GO
  293. /****** Object:  Table [dbo].[Sacrifices]    Script Date: 1/14/2024 10:19:49 AM ******/
  294. SET ANSI_NULLS ON
  295. GO
  296. SET QUOTED_IDENTIFIER ON
  297. GO
  298. CREATE TABLE [dbo].[Sacrifices](
  299.     [CharacterId] [int] NOT NULL,
  300.     [UserId] [int] NOT NULL,
  301.     [SacrificedOn] [datetime] NOT NULL
  302. ) ON [PRIMARY]
  303. GO
  304. /****** Object:  Table [dbo].[Sayings]    Script Date: 1/14/2024 10:19:49 AM ******/
  305. SET ANSI_NULLS ON
  306. GO
  307. SET QUOTED_IDENTIFIER ON
  308. GO
  309. CREATE TABLE [dbo].[Sayings](
  310.     [SayingId] [int] IDENTITY(1,1) NOT NULL,
  311.     [IsGood] [bit] NOT NULL,
  312.     [Text] [nvarchar](max) NOT NULL,
  313.  CONSTRAINT [PK_Sayings] PRIMARY KEY CLUSTERED
  314. (
  315.     [SayingId] ASC
  316. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  317. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  318. GO
  319. /****** Object:  Table [dbo].[Series]    Script Date: 1/14/2024 10:19:49 AM ******/
  320. SET ANSI_NULLS ON
  321. GO
  322. SET QUOTED_IDENTIFIER ON
  323. GO
  324. CREATE TABLE [dbo].[Series](
  325.     [Id] [int] IDENTITY(1,1) NOT NULL,
  326.     [Name] [nvarchar](max) NOT NULL,
  327.     [ImageUrl] [nvarchar](max) NULL,
  328.     [AniCharId] [bigint] NOT NULL,
  329.     [IsCustom] [bit] NULL,
  330.  CONSTRAINT [PK_Series] PRIMARY KEY CLUSTERED
  331. (
  332.     [Id] ASC
  333. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  334. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  335. GO
  336. /****** Object:  Table [dbo].[SeriesToFranchises]    Script Date: 1/14/2024 10:19:49 AM ******/
  337. SET ANSI_NULLS ON
  338. GO
  339. SET QUOTED_IDENTIFIER ON
  340. GO
  341. CREATE TABLE [dbo].[SeriesToFranchises](
  342.     [FranchiseId] [int] NOT NULL,
  343.     [SeriesId] [int] NOT NULL,
  344.     [IsMain] [bit] NOT NULL,
  345.  CONSTRAINT [OneSeries] UNIQUE NONCLUSTERED
  346. (
  347.     [SeriesId] ASC
  348. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  349. ) ON [PRIMARY]
  350. GO
  351. /****** Object:  Table [dbo].[Ships]    Script Date: 1/14/2024 10:19:49 AM ******/
  352. SET ANSI_NULLS ON
  353. GO
  354. SET QUOTED_IDENTIFIER ON
  355. GO
  356. CREATE TABLE [dbo].[Ships](
  357.     [LeftId] [int] NOT NULL,
  358.     [RightId] [int] NOT NULL,
  359.     [ShippedById] [int] NOT NULL,
  360.     [ShipName] [nvarchar](max) NOT NULL
  361. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  362. GO
  363. /****** Object:  Table [dbo].[Stats]    Script Date: 1/14/2024 10:19:49 AM ******/
  364. SET ANSI_NULLS ON
  365. GO
  366. SET QUOTED_IDENTIFIER ON
  367. GO
  368. CREATE TABLE [dbo].[Stats](
  369.     [Id] [int] IDENTITY(1,1) NOT NULL,
  370.     [CharacterId] [int] NOT NULL,
  371.     [RarityId] [int] NOT NULL,
  372.     [RerollCount] [int] NOT NULL,
  373.  CONSTRAINT [PK_Stats] PRIMARY KEY CLUSTERED
  374. (
  375.     [Id] ASC
  376. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  377. ) ON [PRIMARY]
  378. GO
  379. /****** Object:  Table [dbo].[Tags]    Script Date: 1/14/2024 10:19:49 AM ******/
  380. SET ANSI_NULLS ON
  381. GO
  382. SET QUOTED_IDENTIFIER ON
  383. GO
  384. CREATE TABLE [dbo].[Tags](
  385.     [Id] [bigint] IDENTITY(1,1) NOT NULL,
  386.     [Name] [nvarchar](max) NOT NULL,
  387.     [Type] [tinyint] NOT NULL,
  388.     [IsBlacklisted] [bit] NOT NULL,
  389.     [GellyId] [bigint] NULL,
  390.     [Slug] [nvarchar](max) NOT NULL,
  391.  CONSTRAINT [PK_Tags] PRIMARY KEY CLUSTERED
  392. (
  393.     [Id] ASC
  394. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  395. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  396. GO
  397. /****** Object:  Table [dbo].[TimeZones]    Script Date: 1/14/2024 10:19:49 AM ******/
  398. SET ANSI_NULLS ON
  399. GO
  400. SET QUOTED_IDENTIFIER ON
  401. GO
  402. CREATE TABLE [dbo].[TimeZones](
  403.     [Id] [int] IDENTITY(1,1) NOT NULL,
  404.     [TimeZoneId] [nvarchar](max) NOT NULL,
  405.     [HasDST] [bit] NOT NULL,
  406.     [DisplayName] [nvarchar](max) NOT NULL,
  407.     [DSTName] [nvarchar](max) NOT NULL,
  408.     [NonDSTName] [nvarchar](max) NOT NULL,
  409.  CONSTRAINT [PK_TimeZones] PRIMARY KEY CLUSTERED
  410. (
  411.     [Id] ASC
  412. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  413. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  414. GO
  415. /****** Object:  Table [dbo].[TopTen]    Script Date: 1/14/2024 10:19:49 AM ******/
  416. SET ANSI_NULLS ON
  417. GO
  418. SET QUOTED_IDENTIFIER ON
  419. GO
  420. CREATE TABLE [dbo].[TopTen](
  421.     [CharacterId] [int] NOT NULL,
  422.     [UserId] [int] NOT NULL,
  423.     [Position] [tinyint] NOT NULL
  424. ) ON [PRIMARY]
  425. GO
  426. /****** Object:  Table [dbo].[Users]    Script Date: 1/14/2024 10:19:49 AM ******/
  427. SET ANSI_NULLS ON
  428. GO
  429. SET QUOTED_IDENTIFIER ON
  430. GO
  431. CREATE TABLE [dbo].[Users](
  432.     [Id] [int] IDENTITY(1,1) NOT NULL,
  433.     [DiscordId] [nvarchar](max) NOT NULL,
  434.     [Alias] [nvarchar](max) NOT NULL,
  435.     [UserName] [nvarchar](max) NOT NULL,
  436.     [IsBuiltIn] [bit] NOT NULL,
  437.     [TimeZoneId] [int] NULL,
  438.     [SendNotifications] [bit] NOT NULL,
  439.  CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
  440. (
  441.     [Id] ASC
  442. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  443. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  444. GO
  445. /****** Object:  Table [dbo].[Watanagashi]    Script Date: 1/14/2024 10:19:49 AM ******/
  446. SET ANSI_NULLS ON
  447. GO
  448. SET QUOTED_IDENTIFIER ON
  449. GO
  450. CREATE TABLE [dbo].[Watanagashi](
  451.     [Id] [int] IDENTITY(1,1) NOT NULL,
  452.     [CharacterId] [int] NOT NULL,
  453.     [GivenBack] [bit] NOT NULL,
  454.     [TakenOn] [datetime] NOT NULL,
  455.     [UserId] [int] NOT NULL,
  456.     [UserWon] [bit] NOT NULL,
  457.  CONSTRAINT [PK_Watanagashi] PRIMARY KEY CLUSTERED
  458. (
  459.     [Id] ASC
  460. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
  461. ) ON [PRIMARY]
  462. GO
  463. ALTER TABLE [dbo].[Buddies] ADD  CONSTRAINT [DF_Buddies_IsNegative]  DEFAULT ((0)) FOR [IsNegative]
  464. GO
  465. ALTER TABLE [dbo].[Characters] ADD  CONSTRAINT [DF_Characters_SourceId]  DEFAULT ((1)) FOR [SourceId]
  466. GO
  467. ALTER TABLE [dbo].[Characters] ADD  CONSTRAINT [DF_Characters_DibbedById]  DEFAULT ((1)) FOR [DibbedById]
  468. GO
  469. ALTER TABLE [dbo].[DotD] ADD  CONSTRAINT [DF_DotD_CharacterId]  DEFAULT ((1039)) FOR [CharacterId]
  470. GO
  471. ALTER TABLE [dbo].[DotD] ADD  CONSTRAINT [DF_DotD_Date]  DEFAULT (CONVERT([datetime],getdate())) FOR [Date]
  472. GO
  473. ALTER TABLE [dbo].[ElementMatchups] ADD  CONSTRAINT [DF_ElementMatchups_NetEffect]  DEFAULT ((0)) FOR [NetEffect]
  474. GO
  475. ALTER TABLE [dbo].[Elements] ADD  CONSTRAINT [DF_Elements_IsDefault]  DEFAULT ((0)) FOR [IsDefault]
  476. GO
  477. ALTER TABLE [dbo].[Factions] ADD  CONSTRAINT [DF_Factions_HeadId]  DEFAULT ((1191)) FOR [M_HeadId]
  478. GO
  479. ALTER TABLE [dbo].[Factions] ADD  CONSTRAINT [DF_Factions_Element]  DEFAULT ((0)) FOR [PrimaryElementId]
  480. GO
  481. ALTER TABLE [dbo].[Factions] ADD  CONSTRAINT [DF_Factions_F_HeadId]  DEFAULT ((1191)) FOR [F_HeadId]
  482. GO
  483. ALTER TABLE [dbo].[FoxDay] ADD  CONSTRAINT [DF_FoxDay_OccurredOn]  DEFAULT (getdate()) FOR [OccurredOn]
  484. GO
  485. ALTER TABLE [dbo].[Ideas] ADD  CONSTRAINT [DF_Ideas_CreatedById]  DEFAULT ((1)) FOR [CreatedById]
  486. GO
  487. ALTER TABLE [dbo].[Ideas] ADD  CONSTRAINT [DF_Ideas_IsCompleted]  DEFAULT ((0)) FOR [IsCompleted]
  488. GO
  489. ALTER TABLE [dbo].[Ideas] ADD  CONSTRAINT [DF_Ideas_CreatedOn]  DEFAULT (getutcdate()) FOR [CreatedOn]
  490. GO
  491. ALTER TABLE [dbo].[Ideas] ADD  CONSTRAINT [DF_Ideas_ModifiedOn]  DEFAULT (getutcdate()) FOR [ModifiedOn]
  492. GO
  493. ALTER TABLE [dbo].[ImageRelationships] ADD  CONSTRAINT [DF_ImageRelationships_ImageType]  DEFAULT ((0)) FOR [ImageType]
  494. GO
  495. ALTER TABLE [dbo].[Images] ADD  CONSTRAINT [DF_Images_UploadedById]  DEFAULT ((1)) FOR [UploadedById]
  496. GO
  497. ALTER TABLE [dbo].[Images] ADD  CONSTRAINT [DF_Images_UploadedUtc]  DEFAULT (getutcdate()) FOR [UploadedUtc]
  498. GO
  499. ALTER TABLE [dbo].[Reminders] ADD  CONSTRAINT [DF_Reminders_ReminderId]  DEFAULT (newid()) FOR [ReminderId]
  500. GO
  501. ALTER TABLE [dbo].[RerollStats] ADD  CONSTRAINT [DF_RerollStats_RerollCount]  DEFAULT ((0)) FOR [RerollCount]
  502. GO
  503. ALTER TABLE [dbo].[Sacrifices] ADD  CONSTRAINT [DF_Sacrifices_SacrificedOn]  DEFAULT (getutcdate()) FOR [SacrificedOn]
  504. GO
  505. ALTER TABLE [dbo].[Series] ADD  CONSTRAINT [DF_Series_IsCustom]  DEFAULT ((0)) FOR [IsCustom]
  506. GO
  507. ALTER TABLE [dbo].[Ships] ADD  CONSTRAINT [DF_Ships_RightId]  DEFAULT ((1039)) FOR [RightId]
  508. GO
  509. ALTER TABLE [dbo].[Stats] ADD  CONSTRAINT [DF_Stats_RerollCount]  DEFAULT ((0)) FOR [RerollCount]
  510. GO
  511. ALTER TABLE [dbo].[TopTen] ADD  CONSTRAINT [DF_TopTen_Position]  DEFAULT ((10)) FOR [Position]
  512. GO
  513. ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_IsBuiltIn]  DEFAULT ((0)) FOR [IsBuiltIn]
  514. GO
  515. ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_TimeZoneId]  DEFAULT ((2)) FOR [TimeZoneId]
  516. GO
  517. ALTER TABLE [dbo].[Watanagashi] ADD  CONSTRAINT [DF_Watanagashi_TakenOn]  DEFAULT (getutcdate()) FOR [TakenOn]
  518. GO
  519. ALTER TABLE [dbo].[AL_ShipGirls]  WITH CHECK ADD  CONSTRAINT [FK_AL_ShipGirls_Characters] FOREIGN KEY([CharacterId])
  520. REFERENCES [dbo].[Characters] ([Id])
  521. GO
  522. ALTER TABLE [dbo].[AL_ShipGirls] CHECK CONSTRAINT [FK_AL_ShipGirls_Characters]
  523. GO
  524. ALTER TABLE [dbo].[APIAccess]  WITH CHECK ADD  CONSTRAINT [FK_APIAccess_Users] FOREIGN KEY([UserId])
  525. REFERENCES [dbo].[Users] ([Id])
  526. ON DELETE CASCADE
  527. GO
  528. ALTER TABLE [dbo].[APIAccess] CHECK CONSTRAINT [FK_APIAccess_Users]
  529. GO
  530. ALTER TABLE [dbo].[Buddies]  WITH CHECK ADD  CONSTRAINT [FK_Buddies_BuddyStat] FOREIGN KEY([BuddyStatId])
  531. REFERENCES [dbo].[Stats] ([Id])
  532. GO
  533. ALTER TABLE [dbo].[Buddies] CHECK CONSTRAINT [FK_Buddies_BuddyStat]
  534. GO
  535. ALTER TABLE [dbo].[Buddies]  WITH CHECK ADD  CONSTRAINT [FK_Buddies_Stats] FOREIGN KEY([StatId])
  536. REFERENCES [dbo].[Stats] ([Id])
  537. ON DELETE CASCADE
  538. GO
  539. ALTER TABLE [dbo].[Buddies] CHECK CONSTRAINT [FK_Buddies_Stats]
  540. GO
  541. ALTER TABLE [dbo].[Characters]  WITH NOCHECK ADD  CONSTRAINT [FK_Characters_Series] FOREIGN KEY([SourceId])
  542. REFERENCES [dbo].[Series] ([Id])
  543. GO
  544. ALTER TABLE [dbo].[Characters] CHECK CONSTRAINT [FK_Characters_Series]
  545. GO
  546. ALTER TABLE [dbo].[Characters]  WITH NOCHECK ADD  CONSTRAINT [FK_Characters_Users] FOREIGN KEY([DibbedById])
  547. REFERENCES [dbo].[Users] ([Id])
  548. GO
  549. ALTER TABLE [dbo].[Characters] CHECK CONSTRAINT [FK_Characters_Users]
  550. GO
  551. ALTER TABLE [dbo].[CharacterTags]  WITH CHECK ADD  CONSTRAINT [FK_CharacterTags_Characters] FOREIGN KEY([CharacterId])
  552. REFERENCES [dbo].[Characters] ([Id])
  553. ON DELETE CASCADE
  554. GO
  555. ALTER TABLE [dbo].[CharacterTags] CHECK CONSTRAINT [FK_CharacterTags_Characters]
  556. GO
  557. ALTER TABLE [dbo].[CharacterTags]  WITH CHECK ADD  CONSTRAINT [FK_CharacterTags_Tags] FOREIGN KEY([TagId])
  558. REFERENCES [dbo].[Tags] ([Id])
  559. ON DELETE CASCADE
  560. GO
  561. ALTER TABLE [dbo].[CharacterTags] CHECK CONSTRAINT [FK_CharacterTags_Tags]
  562. GO
  563. ALTER TABLE [dbo].[DotD]  WITH CHECK ADD  CONSTRAINT [FK_DotD_Characters] FOREIGN KEY([CharacterId])
  564. REFERENCES [dbo].[Characters] ([Id])
  565. GO
  566. ALTER TABLE [dbo].[DotD] CHECK CONSTRAINT [FK_DotD_Characters]
  567. GO
  568. ALTER TABLE [dbo].[DotD]  WITH CHECK ADD  CONSTRAINT [FK_DotD_Users] FOREIGN KEY([UserId])
  569. REFERENCES [dbo].[Users] ([Id])
  570. GO
  571. ALTER TABLE [dbo].[DotD] CHECK CONSTRAINT [FK_DotD_Users]
  572. GO
  573. ALTER TABLE [dbo].[ElementMatchups]  WITH CHECK ADD  CONSTRAINT [FK_Elements_Matchups_Attack] FOREIGN KEY([AttackingId])
  574. REFERENCES [dbo].[Elements] ([ElementId])
  575. ON DELETE CASCADE
  576. GO
  577. ALTER TABLE [dbo].[ElementMatchups] CHECK CONSTRAINT [FK_Elements_Matchups_Attack]
  578. GO
  579. ALTER TABLE [dbo].[ElementMatchups]  WITH CHECK ADD  CONSTRAINT [FK_Elements_Matchups_Defend] FOREIGN KEY([DefendingId])
  580. REFERENCES [dbo].[Elements] ([ElementId])
  581. GO
  582. ALTER TABLE [dbo].[ElementMatchups] CHECK CONSTRAINT [FK_Elements_Matchups_Defend]
  583. GO
  584. ALTER TABLE [dbo].[FactionMembership]  WITH CHECK ADD  CONSTRAINT [FK_FactionMembership_Characters] FOREIGN KEY([CharacterId])
  585. REFERENCES [dbo].[Characters] ([Id])
  586. ON DELETE CASCADE
  587. GO
  588. ALTER TABLE [dbo].[FactionMembership] CHECK CONSTRAINT [FK_FactionMembership_Characters]
  589. GO
  590. ALTER TABLE [dbo].[FactionMembership]  WITH CHECK ADD  CONSTRAINT [FK_FactionMembership_Factions] FOREIGN KEY([FactionId])
  591. REFERENCES [dbo].[Factions] ([FactionId])
  592. ON DELETE CASCADE
  593. GO
  594. ALTER TABLE [dbo].[FactionMembership] CHECK CONSTRAINT [FK_FactionMembership_Factions]
  595. GO
  596. ALTER TABLE [dbo].[Factions]  WITH CHECK ADD  CONSTRAINT [FK_Factions_Elements_Prim] FOREIGN KEY([PrimaryElementId])
  597. REFERENCES [dbo].[Elements] ([ElementId])
  598. ON DELETE SET DEFAULT
  599. GO
  600. ALTER TABLE [dbo].[Factions] CHECK CONSTRAINT [FK_Factions_Elements_Prim]
  601. GO
  602. ALTER TABLE [dbo].[FoxDay]  WITH CHECK ADD  CONSTRAINT [FK_Daily_FoxDay] FOREIGN KEY([DotDId])
  603. REFERENCES [dbo].[DotD] ([Id])
  604. ON DELETE CASCADE
  605. GO
  606. ALTER TABLE [dbo].[FoxDay] CHECK CONSTRAINT [FK_Daily_FoxDay]
  607. GO
  608. ALTER TABLE [dbo].[Ideas]  WITH CHECK ADD  CONSTRAINT [FK_Ideas_Users] FOREIGN KEY([CreatedById])
  609. REFERENCES [dbo].[Users] ([Id])
  610. GO
  611. ALTER TABLE [dbo].[Ideas] CHECK CONSTRAINT [FK_Ideas_Users]
  612. GO
  613. ALTER TABLE [dbo].[ImageRelationships]  WITH CHECK ADD  CONSTRAINT [FK_ImageRelationships_Characters] FOREIGN KEY([CharacterId])
  614. REFERENCES [dbo].[Characters] ([Id])
  615. ON DELETE CASCADE
  616. GO
  617. ALTER TABLE [dbo].[ImageRelationships] CHECK CONSTRAINT [FK_ImageRelationships_Characters]
  618. GO
  619. ALTER TABLE [dbo].[ImageRelationships]  WITH CHECK ADD  CONSTRAINT [FK_ImageRelationships_Images] FOREIGN KEY([ImageId])
  620. REFERENCES [dbo].[Images] ([Id])
  621. ON DELETE CASCADE
  622. GO
  623. ALTER TABLE [dbo].[ImageRelationships] CHECK CONSTRAINT [FK_ImageRelationships_Images]
  624. GO
  625. ALTER TABLE [dbo].[Images]  WITH NOCHECK ADD  CONSTRAINT [FK_Images_Users] FOREIGN KEY([UploadedById])
  626. REFERENCES [dbo].[Users] ([Id])
  627. GO
  628. ALTER TABLE [dbo].[Images] CHECK CONSTRAINT [FK_Images_Users]
  629. GO
  630. ALTER TABLE [dbo].[ImageTags]  WITH CHECK ADD  CONSTRAINT [FK_ImageTags_Images] FOREIGN KEY([TagId])
  631. REFERENCES [dbo].[Tags] ([Id])
  632. ON DELETE CASCADE
  633. GO
  634. ALTER TABLE [dbo].[ImageTags] CHECK CONSTRAINT [FK_ImageTags_Images]
  635. GO
  636. ALTER TABLE [dbo].[ImageTags]  WITH CHECK ADD  CONSTRAINT [FK_ImageTags_Images1] FOREIGN KEY([ImageId])
  637. REFERENCES [dbo].[Images] ([Id])
  638. ON DELETE CASCADE
  639. GO
  640. ALTER TABLE [dbo].[ImageTags] CHECK CONSTRAINT [FK_ImageTags_Images1]
  641. GO
  642. ALTER TABLE [dbo].[Reminders]  WITH CHECK ADD  CONSTRAINT [FK_Reminders_Users] FOREIGN KEY([UserId])
  643. REFERENCES [dbo].[Users] ([Id])
  644. GO
  645. ALTER TABLE [dbo].[Reminders] CHECK CONSTRAINT [FK_Reminders_Users]
  646. GO
  647. ALTER TABLE [dbo].[RerollStats]  WITH CHECK ADD  CONSTRAINT [FK_RerollStats_Users] FOREIGN KEY([UserId])
  648. REFERENCES [dbo].[Users] ([Id])
  649. ON DELETE CASCADE
  650. GO
  651. ALTER TABLE [dbo].[RerollStats] CHECK CONSTRAINT [FK_RerollStats_Users]
  652. GO
  653. ALTER TABLE [dbo].[Sacrifices]  WITH CHECK ADD  CONSTRAINT [FK_Sacrifices_Characters] FOREIGN KEY([CharacterId])
  654. REFERENCES [dbo].[Characters] ([Id])
  655. ON DELETE CASCADE
  656. GO
  657. ALTER TABLE [dbo].[Sacrifices] CHECK CONSTRAINT [FK_Sacrifices_Characters]
  658. GO
  659. ALTER TABLE [dbo].[Sacrifices]  WITH CHECK ADD  CONSTRAINT [FK_Sacrifices_Users] FOREIGN KEY([UserId])
  660. REFERENCES [dbo].[Users] ([Id])
  661. ON DELETE CASCADE
  662. GO
  663. ALTER TABLE [dbo].[Sacrifices] CHECK CONSTRAINT [FK_Sacrifices_Users]
  664. GO
  665. ALTER TABLE [dbo].[SeriesToFranchises]  WITH NOCHECK ADD  CONSTRAINT [FK_SeriesToFranchises_Franchises] FOREIGN KEY([FranchiseId])
  666. REFERENCES [dbo].[Franchises] ([FranchiseId])
  667. GO
  668. ALTER TABLE [dbo].[SeriesToFranchises] CHECK CONSTRAINT [FK_SeriesToFranchises_Franchises]
  669. GO
  670. ALTER TABLE [dbo].[SeriesToFranchises]  WITH NOCHECK ADD  CONSTRAINT [FK_SeriesToFranchises_Series] FOREIGN KEY([SeriesId])
  671. REFERENCES [dbo].[Series] ([Id])
  672. ON DELETE CASCADE
  673. GO
  674. ALTER TABLE [dbo].[SeriesToFranchises] CHECK CONSTRAINT [FK_SeriesToFranchises_Series]
  675. GO
  676. ALTER TABLE [dbo].[Ships]  WITH CHECK ADD  CONSTRAINT [FK_Ships_Characters_Left] FOREIGN KEY([LeftId])
  677. REFERENCES [dbo].[Characters] ([Id])
  678. GO
  679. ALTER TABLE [dbo].[Ships] CHECK CONSTRAINT [FK_Ships_Characters_Left]
  680. GO
  681. ALTER TABLE [dbo].[Ships]  WITH CHECK ADD  CONSTRAINT [FK_Ships_Characters_Right] FOREIGN KEY([RightId])
  682. REFERENCES [dbo].[Characters] ([Id])
  683. GO
  684. ALTER TABLE [dbo].[Ships] CHECK CONSTRAINT [FK_Ships_Characters_Right]
  685. GO
  686. ALTER TABLE [dbo].[Ships]  WITH CHECK ADD  CONSTRAINT [FK_Ships_Users] FOREIGN KEY([ShippedById])
  687. REFERENCES [dbo].[Users] ([Id])
  688. GO
  689. ALTER TABLE [dbo].[Ships] CHECK CONSTRAINT [FK_Ships_Users]
  690. GO
  691. ALTER TABLE [dbo].[Stats]  WITH CHECK ADD  CONSTRAINT [FK_Stats_Characters] FOREIGN KEY([CharacterId])
  692. REFERENCES [dbo].[Characters] ([Id])
  693. GO
  694. ALTER TABLE [dbo].[Stats] CHECK CONSTRAINT [FK_Stats_Characters]
  695. GO
  696. ALTER TABLE [dbo].[Stats]  WITH CHECK ADD  CONSTRAINT [FK_Stats_Rarities] FOREIGN KEY([RarityId])
  697. REFERENCES [dbo].[Rarities] ([Id])
  698. GO
  699. ALTER TABLE [dbo].[Stats] CHECK CONSTRAINT [FK_Stats_Rarities]
  700. GO
  701. ALTER TABLE [dbo].[TopTen]  WITH CHECK ADD  CONSTRAINT [FK_TopTen_Characters] FOREIGN KEY([CharacterId])
  702. REFERENCES [dbo].[Characters] ([Id])
  703. ON DELETE CASCADE
  704. GO
  705. ALTER TABLE [dbo].[TopTen] CHECK CONSTRAINT [FK_TopTen_Characters]
  706. GO
  707. ALTER TABLE [dbo].[TopTen]  WITH CHECK ADD  CONSTRAINT [FK_TopTen_Users] FOREIGN KEY([UserId])
  708. REFERENCES [dbo].[Users] ([Id])
  709. ON DELETE CASCADE
  710. GO
  711. ALTER TABLE [dbo].[TopTen] CHECK CONSTRAINT [FK_TopTen_Users]
  712. GO
  713. ALTER TABLE [dbo].[Users]  WITH CHECK ADD  CONSTRAINT [FK_Users_TimeZones] FOREIGN KEY([TimeZoneId])
  714. REFERENCES [dbo].[TimeZones] ([Id])
  715. GO
  716. ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [FK_Users_TimeZones]
  717. GO
  718. ALTER TABLE [dbo].[Watanagashi]  WITH CHECK ADD  CONSTRAINT [FK_Watanagashi_Characters] FOREIGN KEY([CharacterId])
  719. REFERENCES [dbo].[Characters] ([Id])
  720. ON DELETE CASCADE
  721. GO
  722. ALTER TABLE [dbo].[Watanagashi] CHECK CONSTRAINT [FK_Watanagashi_Characters]
  723. GO
  724. ALTER TABLE [dbo].[Watanagashi]  WITH CHECK ADD  CONSTRAINT [FK_Watanagashi_Users] FOREIGN KEY([UserId])
  725. REFERENCES [dbo].[Users] ([Id])
  726. ON DELETE CASCADE
  727. GO
  728. ALTER TABLE [dbo].[Watanagashi] CHECK CONSTRAINT [FK_Watanagashi_Users]
  729. GO
  730. ALTER TABLE [dbo].[ElementMatchups]  WITH CHECK ADD  CONSTRAINT [CK_NetEffect_IsInRange] CHECK  (([NetEffect]>=(-1) AND [NetEffect]<=(1)))
  731. GO
  732. ALTER TABLE [dbo].[ElementMatchups] CHECK CONSTRAINT [CK_NetEffect_IsInRange]
  733. GO
  734. ALTER TABLE [dbo].[Factions]  WITH CHECK ADD  CONSTRAINT [CK_FactionElements] CHECK  (([PrimaryElementId]<>coalesce([SecondaryElementId],(0))))
  735. GO
  736. ALTER TABLE [dbo].[Factions] CHECK CONSTRAINT [CK_FactionElements]
  737. GO
  738.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement