-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathschema.sql
More file actions
52 lines (48 loc) · 1.59 KB
/
schema.sql
File metadata and controls
52 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CREATE TABLE [dbo].[BeatSaberSong](
[BeatSaverKey] [int] NOT NULL,
[Hash] [binary](20) NOT NULL,
[Uploader] [nvarchar](4000) NOT NULL,
[Uploaded] [datetime2] NULL,
[Difficulties] [int] NOT NULL,
[Bpm] [float] NOT NULL,
[LevelAuthorName] [nvarchar](4000) NOT NULL,
[SongAuthorName] [nvarchar](4000) NOT NULL,
[SongName] [nvarchar](4000) NOT NULL,
[SongSubName] [nvarchar](4000) NOT NULL,
[Name] [nvarchar](4000) NOT NULL,
[AutoMapper] [bit] NOT NULL,
[CreatedAt] datetime2(7) NOT NULL,
[UpdatedAt] datetime2(7) NOT NULL,
[LastPublishedAt] datetime2(7) NULL,
[DeletedAt] datetime2(7) NULL
CONSTRAINT [PK_BeatSaberSong] PRIMARY KEY CLUSTERED
(
[BeatSaverKey] ASC
)
) ON [PRIMARY]
GO
CREATE FULLTEXT CATALOG [BeatSaverCatalog] WITH ACCENT_SENSITIVITY = ON
AS DEFAULT
GO
CREATE FULLTEXT INDEX ON BeatSaberSong(LevelAuthorName, SongAuthorName, SongName, SongSubName, Name) KEY INDEX PK_BeatSaberSong
GO
CREATE INDEX IDX_BeatSaberSong_DeletedAt_AutoMapper_Difficulties ON BeatSaverMatcher.dbo.BeatSaberSong (DeletedAt, AutoMapper, Difficulties)
GO
BEGIN TRANSACTION
GO
CREATE TABLE dbo.BeatSaberSongRatings
(
BeatSaverKey int NOT NULL,
Upvotes int NOT NULL,
Downvotes int NOT NULL,
Score float(53) NOT NULL,
UpdatedAt datetime2(7) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.BeatSaberSongRatings ADD CONSTRAINT
PK_BeatSaberSongRatings PRIMARY KEY CLUSTERED
(
BeatSaverKey
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
COMMIT