From a4d2da872a296fd915566a77b48247f9df28c2c3 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Wed, 30 Nov 2016 21:46:40 +0100 Subject: [PATCH] More docs --- docs/api/feature-toggles-api.md | 2 +- docs/api/index.md | 4 +++- docs/{schema.md => database-schema.md} | 33 +++++++++++++++++++++++--- docs/getting-started.md | 13 +++++++--- 4 files changed, 44 insertions(+), 8 deletions(-) rename docs/{schema.md => database-schema.md} (64%) diff --git a/docs/api/feature-toggles-api.md b/docs/api/feature-toggles-api.md index c85edae6ab..db4cae6360 100644 --- a/docs/api/feature-toggles-api.md +++ b/docs/api/feature-toggles-api.md @@ -143,7 +143,7 @@ Returns 200-respose if the feature toggle was updated successfully. Used to archive a feature toggle. A feature toggle can never be totally be deleted, but can be archived. This is a design decision to make sure that a old feature -toggle suddnely reapear by some one else reusing the same name. +toggle suddenly reappears becuase someone else re-using the same name. ## Archive diff --git a/docs/api/index.md b/docs/api/index.md index 0e208687a0..ea1864d332 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,6 +1,8 @@ # API Documentation -Contents: +Version: 1.0 + +**Contents:** * [Feature Toggles API](feature-toggles-api.md) * [Strategies API](strategies-api.md) diff --git a/docs/schema.md b/docs/database-schema.md similarity index 64% rename from docs/schema.md rename to docs/database-schema.md index a4790b5144..f0678a2e12 100644 --- a/docs/schema.md +++ b/docs/database-schema.md @@ -1,6 +1,7 @@ # Schema -This document describes our current database schama used in PostgreSQL +This document describes our current database schama used in PostgreSQL. +We use db-migrate to migrate (create tables, add columns etc) the database. ## Table: _migrations_ @@ -12,8 +13,6 @@ Used by db-migrate module to keep track of migrations. | name | varchar | 255 | 0 | (null) | | run_on | timestamp | 29 | 0 | (null) | - - ## Table: _events_ | NAME | TYPE | SIZE | NULLABLE | COLUMN_DEF | | ----------- | --------- | ----------- | -------- | ---------------------------------- | @@ -43,3 +42,31 @@ Used by db-migrate module to keep track of migrations. | description | text | 2147483647 | 1 | (null) | | | archived | int4 | 10 | 1 | 0 | | | strategies | json | 2147483647 | 1 | (null) | | + + +## Table: _client_strategies_ + +| COLUMN_NAME | TYPE_NAME | COLUMN_SIZE | NULLABLE | COLUMN_DEF | +| ----------- | --------- | ----------- | -------- | ---------- | +| app_name | varchar | 255 | 0 | (null) | +| updated_at | timestamp | 29 | 1 | now() | +| strategies | json | 2147483647 | 1 | (null) | + + +## Table: _client_instances_ + +| COLUMN_NAME | TYPE_NAME | COLUMN_SIZE | NULLABLE | COLUMN_DEF | +| ----------- | --------- | ----------- | -------- | ---------- | +| app_name | varchar | 255 | 1 | (null) | +| instance_id | varchar | 255 | 1 | (null) | +| client_ip | varchar | 255 | 1 | (null) | +| last_seen | timestamp | 29 | 1 | now() | +| created_at | timestamp | 29 | 1 | now() | + +## Table: _client_metrics_ + +| COLUMN_NAME | TYPE_NAME | COLUMN_SIZE | NULLABLE | COLUMN_DEF | +| ----------- | --------- | ----------- | -------- | ------------------------------------------ | +| id | serial | 10 | 0 | nextval('client_metrics_id_seq'::regclass) | +| created_at | timestamp | 29 | 1 | now() | +| metrics | json | 2147483647 | 1 | (null) | diff --git a/docs/getting-started.md b/docs/getting-started.md index eabe5d0115..83c7ce8d3b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,6 +1,13 @@ -(unleash-server is currently not released yet with these capabilites, but when it is this is how to use unleash) +# Getting stated (v.1.0.x) -### The simplest way to get started: +### Prerequisite +To run unleash you need to provide a PostgreSQL databse (PostgreSQL v.9.5.x or newer). + +You need to give unleash a database uri which includes a username and password, that have rights to +migrate the database. _Unleash_ will, at startup, check whether database migration is needed, +and perform necessary migrations. + +### 1. The simplest way to get started: ```bash $ npm install unleash-server -g @@ -9,7 +16,7 @@ $ unleash -d postgres://unleash_user:passord@localhost:5432/unleash -p 4242 Unleash started on port:4242 ``` -### Or programmatically: +### 2. Or programmatically: ```js const unleash = require('unleash-server');