Skip to content

Commit

Permalink
Added DDL scripts for OSlash clone db
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrash committed Oct 15, 2022
1 parent 5bf9ae2 commit 9e005a1
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 170 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
41 changes: 41 additions & 0 deletions DDL.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-- DB DDL script for OSlash clone

CREATE TABLE `user`
(
`id` bigint NOT NULL ,
`email` varchar(100) NOT NULL ,
`password` varchar(100) NOT NULL ,
`created_dttm` datetime NOT NULL ,
`updated_dttm` datetime NOT NULL ,

PRIMARY KEY (`id`)
);


CREATE TABLE `shortcut`
(
`id` bigint NOT NULL ,
`short_link` varchar(60) NOT NULL ,
`user_id` bigint NOT NULL ,
`description` varchar(250) NOT NULL ,
`created_dttm` datetime NOT NULL ,
`update_dttm` datetime NOT NULL ,

PRIMARY KEY (`id`),
KEY `FK_2` (`user_id`),
CONSTRAINT `FK_1` FOREIGN KEY `FK_2` (`user_id`) REFERENCES `user` (`id`)
);


CREATE TABLE `tags`
(
`id` bigint NOT NULL ,
`shortcut_id` bigint NOT NULL ,
`tag` varchar(45) NOT NULL ,
`created_dttm` datetime NOT NULL ,
`updated_dttm` datetime NOT NULL ,

PRIMARY KEY (`id`),
KEY `FK_2` (`shortcut_id`),
CONSTRAINT `FK_2` FOREIGN KEY `FK_2` (`shortcut_id`) REFERENCES `shortcut` (`id`)
);
Loading

0 comments on commit 9e005a1

Please sign in to comment.