Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
Added database installation script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rembane committed Sep 20, 2017
1 parent aff1615 commit 0d3f739
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,24 @@ Regular users can (on their own aliases):
- Request new email aliases that will be approved by admins

## Setup instructions
WIP

This is the raw way to setup your development environment.

### Database

We run MySQL because legacy, so install MySQL and then run this:

```
echo 'create database email;' | mysql -u root
mysql -u root email < scripts/create-db.sql
```

### Haskell

Install `stack` and then run:

```
stack install
```

If you get any error or get stuck, please file an issue.
62 changes: 62 additions & 0 deletions scripts/create-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: email
-- ------------------------------------------------------
-- Server version 10.1.26-MariaDB-0+deb9u1

/*!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 */;
/*!40101 SET NAMES utf8mb4 */;
/*!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 `aliases`
--

DROP TABLE IF EXISTS `aliases`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aliases` (
`alias_id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
`forward_address` varchar(255) NOT NULL,
`password` varchar(255) DEFAULT NULL COMMENT 'Primary keys are both alias',
`cid` varchar(30) DEFAULT NULL,
`is_maillist` tinyint(1) DEFAULT '0',
PRIMARY KEY (`alias_id`),
KEY `domain-alias-index` (`domain`,`alias`)
) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `smtp_reset_tokens`
--

DROP TABLE IF EXISTS `smtp_reset_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `smtp_reset_tokens` (
`alias_id` int(11) NOT NULL,
`token` varchar(255) DEFAULT NULL,
`generation_date` int(11) DEFAULT NULL,
PRIMARY KEY (`alias_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!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 2017-09-20 21:50:33

0 comments on commit 0d3f739

Please sign in to comment.