-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SQLite script to project just for reference
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- Code Librarian SQLite Script | ||
-- This script was used to create the database. It's not pure SQLite, but this was intentional. | ||
|
||
CREATE TABLE "Language" ( | ||
"LanguageId" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, | ||
"Name" NVARCHAR(30) NOT NULL UNIQUE | ||
); | ||
|
||
CREATE UNIQUE INDEX "ix_language_name" ON "Language" ( | ||
"Name" | ||
); | ||
|
||
CREATE TABLE "Author" ( | ||
"AuthorId" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, | ||
"Name" NVARCHAR(60) NOT NULL UNIQUE, | ||
"ContactInfo" NVARCHAR(254) NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX "ix_author_name" ON "Author" ( | ||
"Name" | ||
); | ||
|
||
CREATE TABLE "Snippet" ( | ||
"SnippetId" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, | ||
"AuthorId" INTEGER NOT NULL, | ||
"Title" NVARCHAR(50) NOT NULL, | ||
"Purpose" NVARCHAR(255) NOT NULL, | ||
"DateCreated" DATETIME NOT NULL, | ||
"DateUpdated" DATETIME NOT NULL, | ||
"Version" NVARCHAR(8) NOT NULL, | ||
"LanguageId" INTEGER NOT NULL, | ||
"Keywords" NVARCHAR(255) NOT NULL, | ||
"CodeSnippet" NVARCHAR(60000) NOT NULL, | ||
FOREIGN KEY("AuthorId") REFERENCES "Author"("AuthorId") | ||
ON DELETE NO ACTION | ||
ON UPDATE CASCADE, | ||
FOREIGN KEY("LanguageId") REFERENCES "Language"("LanguageId") | ||
ON DELETE NO ACTION | ||
ON UPDATE CASCADE | ||
); | ||
|
||
CREATE UNIQUE INDEX "ix_snippet_title_language" ON "Snippet" ( | ||
"Title", | ||
"LanguageId" | ||
); |