# Installation

1. Drag and drop the resource into your `resources` folder

2. Ensure that it is started **after** lb-phone, ex:

   ```cfscript
   start lb-phone
   start devm-tea-app
   ```

3. The SQL should import automatically, however if it doesnt, run this:&#x20;

   ```sql
   CREATE TABLE IF NOT EXISTS `tea_comments` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `post_id` int(11) NOT NULL,
     `author_identifier` varchar(64) NOT NULL,
     `message` text NOT NULL,
     `created_at` timestamp NULL DEFAULT current_timestamp(),
     PRIMARY KEY (`id`),
     KEY `post_id` (`post_id`),
     CONSTRAINT `tea_comments_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `tea_posts` (`id`) ON DELETE CASCADE
   ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

   CREATE TABLE IF NOT EXISTS `tea_posts` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `author_identifier` varchar(64) NOT NULL,
     `title` varchar(255) NOT NULL,
     `image_url` text DEFAULT NULL,
     `description` text DEFAULT NULL,
     `created_at` timestamp NULL DEFAULT current_timestamp(),
     `like_count` int(11) NOT NULL DEFAULT 0,
     `dislike_count` int(11) NOT NULL DEFAULT 0,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

   CREATE TABLE IF NOT EXISTS `tea_post_reactions` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `post_id` int(11) NOT NULL,
     `reactor_identifier` varchar(64) NOT NULL,
     `reaction` enum('like','dislike') NOT NULL,
     `created_at` timestamp NULL DEFAULT current_timestamp(),
     PRIMARY KEY (`id`),
     UNIQUE KEY `uniq_post_reactor` (`post_id`,`reactor_identifier`),
     CONSTRAINT `tea_post_reactions_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `tea_posts` (`id`) ON DELETE CASCADE
   ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

   CREATE TABLE IF NOT EXISTS `tea_profiles` (
     `identifier` varchar(64) NOT NULL,
     `username` varchar(64) NOT NULL DEFAULT '',
     `avatar` text DEFAULT NULL,
     PRIMARY KEY (`identifier`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

   ```
