From 3b93b9de3c04509f4cd0bb06fdd3ab8ed515367e Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Sun, 10 Nov 2019 19:51:38 +0530 Subject: [PATCH] Add script files --- scripts/mysql.sql | 85 +++++++++++++++ scripts/swagger.json | 241 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 326 insertions(+) create mode 100644 scripts/mysql.sql create mode 100644 scripts/swagger.json diff --git a/scripts/mysql.sql b/scripts/mysql.sql new file mode 100644 index 0000000..3017f02 --- /dev/null +++ b/scripts/mysql.sql @@ -0,0 +1,85 @@ +CREATE DATABASE IF NOT EXISTS `sef_giraffe` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `sef_giraffe`; +-- MySQL dump 10.13 Distrib 8.0.14, for macos10.14 (x86_64) +-- +-- Host: localhost Database: sef_giraffe +-- ------------------------------------------------------ +-- Server version 8.0.13 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +SET NAMES utf8 ; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `board` +-- + +DROP TABLE IF EXISTS `board`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +SET character_set_client = utf8mb4 ; +CREATE TABLE `board` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(100) NOT NULL, + `image` varchar(250) NOT NULL, + `description` text, + `status` varchar(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `entity` +-- + +DROP TABLE IF EXISTS `entity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +SET character_set_client = utf8mb4 ; +CREATE TABLE `entity` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `image` varchar(250) NOT NULL, + `board_id` int(11) NOT NULL, + `status` varchar(10) NOT NULL, + PRIMARY KEY (`id`), + KEY `fk_entity_board_idx` (`board_id`), + CONSTRAINT `fk_entity_board` FOREIGN KEY (`board_id`) REFERENCES `board` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `score` +-- + +DROP TABLE IF EXISTS `score`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +SET character_set_client = utf8mb4 ; +CREATE TABLE `score` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `entity_id` int(11) NOT NULL, + `description` varchar(250) DEFAULT NULL, + `points` int(11) NOT NULL, + `created_at` bigint(20) NOT NULL, + `status` varchar(10) NOT NULL, + PRIMARY KEY (`id`), + KEY `fk_score_entity1_idx` (`entity_id`), + CONSTRAINT `fk_score_entity1` FOREIGN KEY (`entity_id`) REFERENCES `entity` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2019-11-10 19:43:48 diff --git a/scripts/swagger.json b/scripts/swagger.json new file mode 100644 index 0000000..64aa0bc --- /dev/null +++ b/scripts/swagger.json @@ -0,0 +1,241 @@ +{ + "swagger":"2.0", + "paths":{ + "/boards":{ + "get":{ + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + }, + "post":{ + "parameters":[ + { + "name":"Payload", + "description":"Request Body", + "required":false, + "in":"body", + "schema":{ + "type":"object", + "properties":{ + "payload":{ + "type":"string" + } + } + } + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/boards/{board-id}":{ + "get":{ + "parameters":[ + { + "name":"board-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"None", + "x-throttling-tier":"Unlimited" + }, + "delete":{ + "parameters":[ + { + "name":"board-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/entities":{ + "get":{ + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + }, + "post":{ + "parameters":[ + { + "name":"Payload", + "description":"Request Body", + "required":false, + "in":"body", + "schema":{ + "type":"object", + "properties":{ + "payload":{ + "type":"string" + } + } + } + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/entities/{entity-id}":{ + "get":{ + "parameters":[ + { + "name":"entity-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"None", + "x-throttling-tier":"Unlimited" + }, + "delete":{ + "parameters":[ + { + "name":"entity-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/entities/{entity-id}/scores":{ + "get":{ + "parameters":[ + { + "name":"entity-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"None", + "x-throttling-tier":"Unlimited" + }, + "post":{ + "parameters":[ + { + "name":"entity-id", + "in":"path", + "required":true, + "type":"string" + }, + { + "name":"Payload", + "description":"Request Body", + "required":false, + "in":"body", + "schema":{ + "type":"object", + "properties":{ + "payload":{ + "type":"string" + } + } + } + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/scores/{score-id}":{ + "delete":{ + "parameters":[ + { + "name":"score-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"Application & Application User", + "x-throttling-tier":"Unlimited" + } + }, + "/boards/{board-id}/scores":{ + "get":{ + "parameters":[ + { + "name":"board-id", + "in":"path", + "required":true, + "type":"string" + } + ], + "responses":{ + "200":{ + "description":"" + } + }, + "x-auth-type":"None", + "x-throttling-tier":"Unlimited" + } + } + }, + "info":{ + "title":"Giraffe", + "version":"v1" + } +} \ No newline at end of file