From 214bdd03589c3afb541b0b2293670479e7c6d8a8 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sat, 20 Jun 2020 20:44:54 -0600 Subject: [PATCH] Reorganize sections on readme to make more sense --- README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 77c61ca..6fa7e82 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,6 @@ A simple view counter for a website -### Database initialization - -The following SQL will initialize the database for this application. No automigrate / initialization is done upon first running the application, so this must be ran by an administrator. - -```sql -SET NAMES utf8; -SET time_zone = '+00:00'; -SET foreign_key_checks = 0; - -CREATE DATABASE `counter` /*!40100 DEFAULT CHARACTER SET latin1 */; -USE `counter`; - -CREATE TABLE `visit` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `ip_address` varchar(15) NOT NULL, - `visits` int(11) NOT NULL, - `last_visited` datetime NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -``` - ### Build Container Disclaimer! If you use this, you'll need to build the container yourself. My registry is used for my internal infrastructure only and is not publicly available. @@ -67,6 +45,28 @@ services: ``` +### Database initialization + +The following SQL will initialize the database for this application. No automigrate / initialization is done upon first running the application, so this must be ran by an administrator. + +```sql +SET NAMES utf8; +SET time_zone = '+00:00'; +SET foreign_key_checks = 0; + +CREATE DATABASE `counter` /*!40100 DEFAULT CHARACTER SET latin1 */; +USE `counter`; + +CREATE TABLE `visit` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ip_address` varchar(15) NOT NULL, + `visits` int(11) NOT NULL, + `last_visited` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +``` + ### Example front end usage You can pretty much implement this in your front end however you want, you just need to make a GET request to whatever endpoint the counter container is running at. This is how I use it though...