Skip to content

Commit

Permalink
Issue #2: Create a database table to hold login credentials
Browse files Browse the repository at this point in the history
Created table ir_login.
  • Loading branch information
gurusami committed Feb 17, 2022
1 parent fdb8ec3 commit fc8ca43
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
10 changes: 8 additions & 2 deletions HOWTO.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ <h2> Backup of Database </h2>

<h2> Administrative Work on Database </h2>

<p> To do all administrative work, the user queen@localhost is used. Since this webapp
uses only the database <i>kdb</i>, the following command should work. </p>
<p> To do all administrative work, the user queen@localhost is used. Since this
webapp uses only the database <i>kdb</i>, the following command should work.
</p>

<pre>
$ mysql -u queen -p kdb
Expand All @@ -79,8 +80,13 @@ <h2> Database Tables </h2>
<li> The table <i>ir_people</i> is used to store information about any person
who needs to interact with the system. Each person is assigned a unique nick
name (maximum length of 8 chars). </li>
<li> The table <i>ir_login</i> is used to store login credentials of any user
who needs access to the iragu application. Only authenticated users can do
anything useful. Password is stored as SHA2(password, 256) function of MySQL.
</li>
</ul>


<h2> Operations </h2>

<ul>
Expand Down
19 changes: 18 additions & 1 deletion data-model/kdb-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `kdb` /*!40100 DEFAULT CHARACTER SET ut

USE `kdb`;

--
-- Table structure for table `ir_login`
--

DROP TABLE IF EXISTS `ir_login`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ir_login` (
`username` char(8) NOT NULL,
`token` char(64) NOT NULL,
`usertype` enum('CUSTOMER','SERVICE') DEFAULT 'CUSTOMER',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`username`),
CONSTRAINT `user_has_nick` FOREIGN KEY (`username`) REFERENCES `ir_people` (`nick`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ir_people`
--
Expand Down Expand Up @@ -52,4 +69,4 @@ CREATE TABLE `ir_people` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2022-02-16 22:09:07
-- Dump completed on 2022-02-17 19:26:10

0 comments on commit fc8ca43

Please sign in to comment.