---
# System prepended metadata

title: CodiMD を自前でホスティング　2021-03-17
tags: [HackMD, CodiMD, Ubuntu, Docker]

---

---
lang: ja-jp
breaks: true
---
# CodiMD を自前でホスティング　2021-03-17

> Docker Deployment
> https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-docker-deployment

> さくらクラウドで CodiMD を試す #15
> https://github.com/laughk/TIL/issues/15

> docker-compose で imgur を使わない HackMD 環境を構築
> https://kuratsuki.net/2019/04/imgur-%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%AA%E3%81%84-hackmd-%E7%92%B0%E5%A2%83%E3%82%92%E6%A7%8B%E7%AF%89/

hedgedocは、PlantUMLに対応していなかった。
https://hedgedoc.org/
https://github.com/hedgedoc/hedgedoc

docker-hackmd　は、Archived となっておりバージョンも古い為使用しない。
https://github.com/hackmdio/docker-hackmd

> github hackmdio/codimd
> https://github.com/hackmdio/codimd

## CodiMD Manual Deployment

> CodiMD Manual Deployment
> https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-manual-deployment

> CodiMDをネイティブインストールしてみた
> https://wiki.infra-workshop.tech/user/ban/%E3%83%A1%E3%83%A2/CodiMD%E3%82%92%E3%83%8D%E3%82%A4%E3%83%86%E3%82%A3%E3%83%96%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F

## 事前準備

```shell=
$ sudo apt install nodejs
$ sudo apt install npm
```

##### バージョン確認
```shell=
$ node -v
v10.19.0
$ npm -v
6.14.4
```

##### 必要なモジュールをインストール
```shell=
$ npm install --save express
$ npm install ejs
$ npm install node-gyp
```
## PostgreSQLをインストール
<iframe src="https://hackmd.io/BE8JkuBfTcqlbyaPUuLVmw" width="100%" height="500"></iframe>

## PostgreSQLに 「role_codimd」ユーザを追加
```shell=
$ sudo -u postgres psql
psql (12.6 (Ubuntu 12.6-0ubuntu0.20.10.1))
Type "help" for help.

postgres=#

postgres=# CREATE ROLE role_codimd WITH LOGIN PASSWORD 'Password';
CREATE ROLE
postgres=# \du
                                    List of roles
  Role name  |                         Attributes                         | Member of
-------------+------------------------------------------------------------+-----------
 postgres    | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 role_codimd |                                                            | {}
```

## PostgreSQLに データベース「codimd」を追加

```shell=
postgres=# create database codimd owner role_codimd encoding 'UTF8';
CREATE DATABASE
postgres=# \l

                                   List of databases
   Name    |    Owner    | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+-------------+----------+-------------+-------------+-----------------------
 codimd    | role_codimd | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 |
 postgres  | postgres    | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 |
 template0 | postgres    | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres          +
           |             |          |             |             | postgres=CTc/postgres
 template1 | postgres    | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres          +
           |             |          |             |             | postgres=CTc/postgres
(4 rows)

(END)
\q
postgres=# \q
$
```

## codimd のセットアップ

```shell=
$ cd ~/work/hackmdio
```

```shell=
git clone https://github.com/hackmdio/codimd.git
```


```shell=
$ cd ~/work/hackmdio/codimd
```

```shell=
$ npm install package.json
```

```shell=
$ ./bin/setup
copy config files
install packages
npm WARN prometheus-api-metrics@2.2.5 requires a peer of prom-client@11.x but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 2098 packages in 9.935s

54 packages are looking for funding
  run `npm fund` for details

found 293 vulnerabilities (260 low, 17 moderate, 16 high)
  run `npm audit fix` to fix them, or `npm audit` for details


Edit the following config file to setup CodiMD server and client.
Read more info at https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration

* config.json           -- CodiMD config
* .sequelizerc          -- db config
```

## CodiMDの設定 

> CodiMD Configuration
> https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration#undefined

> Development - Environment Variable Specific Configs
> https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration#Development---Environment-Variable-Specific-Configs

```shell=
$ vim config.json
```

「development」と「production」の「db」部分を設定。
```json=
        "db": {
            "username": "role_codimd",
            "password": "Password",
            "database": "codimd",
            "host": "localhost",
            "port": "5432",
            "dialect": "postgres"
        },
```

設定ファイル全体
```json=
{
    "test": {
        "db": {
            "dialect": "sqlite",
            "storage": ":memory:"
        },
        "linkifyHeaderStyle": "gfm"
    },
    "development": {
        "loglevel": "debug",
        "hsts": {
            "enable": false
        },
        "db": {
            "username": "role_codimd",
            "password": "Password",
            "database": "codimd",
            "host": "localhost",
            "port": "5432",
            "dialect": "postgres"
        },

        "linkifyHeaderStyle": "gfm"
    },
    "production": {
        "domain": "localhost",
        "loglevel": "debug",
        "hsts": {
            "enable": true,
            "maxAgeSeconds": 31536000,
            "includeSubdomains": true,
            "preload": true
        },
        "csp": {
            "enable": true,
            "directives": {
            },
            "upgradeInsecureRequests": "auto",
            "addDefaults": true,
            "addDisqus": true,
            "addGoogleAnalytics": true
        },
        "db": {
            "username": "role_codimd",
            "password": "Password",
            "database": "codimd",
            "host": "localhost",
            "port": "5432",
            "dialect": "postgres"
        },
        "facebook": {
            "clientID": "change this",
            "clientSecret": "change this"
        },
        "twitter": {
            "consumerKey": "change this",
            "consumerSecret": "change this"
        },
        "github": {
            "clientID": "change this",
            "clientSecret": "change this"
        },
        "gitlab": {
            "baseURL": "change this",
            "clientID": "change this",
            "clientSecret": "change this",
            "scope": "use 'read_user' scope for auth user only or remove this property if you need gitlab snippet import/export support (will result to be default scope 'api')",
            "version": "use 'v4' if gitlab version > 11, 'v3' otherwise. Default to 'v4'"
        },
        "mattermost": {
            "baseURL": "change this",
            "clientID": "change this",
            "clientSecret": "change this"
        },
        "dropbox": {
            "clientID": "change this",
            "clientSecret": "change this",
            "appKey": "change this"
        },
        "google": {
            "clientID": "change this",
            "clientSecret": "change this",
            "apiKey": "change this"
        },
        "ldap": {
            "url": "ldap://change_this",
            "bindDn": null,
            "bindCredentials": null,
            "searchBase": "change this",
            "searchFilter": "change this",
            "searchAttributes": ["change this"],
            "usernameField": "change this e.g. cn",
            "useridField": "change this e.g. uid",
            "tlsOptions": {
                "changeme": "See https://nodejs.org/api/tls.html#tls_tls_connect_options_callback"
            }
        },
        "saml": {
            "idpSsoUrl": "change: authentication endpoint of IdP",
            "idpCert": "change: certificate file path of IdP in PEM format",
            "issuer": "change or delete: identity of the service provider (default: serverurl)",
            "identifierFormat": "change or delete: name identifier format (default: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress')",
            "disableRequestedAuthnContext": "change or delete: true to allow any authentication method, false restricts to password authentication method (default: false)",
            "groupAttribute": "change or delete: attribute name for group list (ex: memberOf)",
            "requiredGroups": [ "change or delete: group names that allowed" ],
            "externalGroups": [ "change or delete: group names that not allowed" ],
            "attribute": {
               "id": "change or delete this: attribute map for `id` (default: NameID)",
               "username": "change or delete this: attribute map for `username` (default: NameID)",
               "email": "change or delete this: attribute map for `email` (default: NameID)"
            }
        },
        "imgur": {
            "clientID": "change this"
        },
        "minio": {
          "accessKey": "change this",
          "secretKey": "change this",
          "endPoint": "change this",
          "secure": true,
          "port": 9000
        },
        "s3": {
          "accessKeyId": "change this",
          "secretAccessKey": "change this",
          "region": "change this"
        },
        "s3bucket": "change this",
        "azure":
        {
          "connectionString": "change this",
          "container": "change this"
        },
        "plantuml":
        {
          "server": "https://www.plantuml.com/plantuml"
        },
        "linkifyHeaderStyle": "gfm"
    }
}
```

## Modify the file named .sequelizerc, change the value of the variable url with your db connection string. For example: postgres://username:password@localhost:5432/codimd

```shell=
$ vim .sequelizerc
```

`url: process.env['postgres://role_codimd:Password@localhost:5432/codimd'] || config.dbURL` の部分を設定
```=
const path = require('path')
const config = require('./lib/config')

module.exports = {
  config: path.resolve('config.js'),
  'migrations-path': path.resolve('lib', 'migrations'),
  'models-path': path.resolve('lib', 'models'),
  url: process.env['postgres://role_codimd:Password@localhost:5432/codimd'] || config.dbURL
}
```

## Build front-end bundle with webpack.
> Webpack
> https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-webpack#undefined

```shell=
npm run build
```

```shell=
$ npm run build

> codimd@2.3.2 build /home/xxxxxxxx/work/hackmdio/codimd
> webpack --config webpack.prod.js --display errors-only -p

Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Child app:
    Hash: 11a304feb34b7da7782c
    Version: webpack 4.39.1
    Time: 59302ms
    Built at: 2021/04/29 19:13:20
    Entrypoint font = font.css font.2766ae0f02de3d45f349.js
    Entrypoint common = common.20f0ebbf2479b8f6d9f4.js
    Entrypoint cover = cover.css cover.c2f169b40f3018a93d76.js
    Entrypoint cover-styles-pack = cover-styles-pack.css cover-styles-pack.7426917c13a6d803517f.js
    Entrypoint cover-pack [big] = cover-pack.css cover-pack.97360d007dee48c4aeb4.js
    Entrypoint index [big] = index.css index.880265080eea349dc10d.js
    Entrypoint index-styles = index-styles.css index-styles.29715afa7c305e2d8e52.js
    Entrypoint index-styles-pack = index-styles-pack.css index-styles-pack.578697cc803d54a6cc5b.js
    Entrypoint index-pack [big] = index-pack.css index-pack.1d373d2f34f0ffe69255.js
    Entrypoint pretty [big] = pretty.css pretty.5f033c71b7bd43182307.js
    Entrypoint pretty-styles = pretty-styles.css pretty-styles.4a0e232f2514b3829762.js
    Entrypoint pretty-styles-pack = pretty-styles-pack.css pretty-styles-pack.e98ad4f4b500e8d23d86.js
    Entrypoint pretty-pack [big] = pretty-pack.css pretty-pack.be9045fb2df8d5a6a88b.js
    Entrypoint slide [big] = slide.css slide.01fe49f7e11b6ad268ad.js
    Entrypoint slide-styles = slide-styles.css slide-styles.39e2ae401c04187f0f04.js
    Entrypoint slide-styles-pack = slide-styles-pack.css slide-styles-pack.59b46e6f9f4f75fc8b7b.js
    Entrypoint slide-pack [big] = slide-pack.css slide-pack.1ef8e5f358776493856b.js
    [1160] ./public/css/google-font.css 39 bytes {4} [built]
    [1161] multi expose-loader?jQuery!expose-loader?$!jquery velocity-animate imports-loader?$=jquery!jquery-mousewheel bootstrap 64 bytes {0} [built]
    [1175] multi babel-polyfill ./public/js/cover.js 40 bytes {1} [built]
    [1176] multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./public/css/bootstrap-social.css ./node_modules/select2/select2.css ./node_modules/select2/select2-bootstrap.css 64 bytes {3} [built]
    [1179] multi babel-polyfill bootstrap-validator expose-loader?select2!select2 expose-loader?moment!moment ./public/js/cover.js 76 bytes {2} [built]
    [1183] multi babel-polyfill script-loader!jquery-ui-resizable script-loader!codemirror script-loader!inlineAttachment script-loader!jqueryTextcomplete script-loader!codemirrorInlineAttachment script-loader!ot flowchart.js imports-loader?Raphael=raphael!js-sequence-diagrams expose-loader?RevealMarkdown!reveal-markdown ./public/js/index.js 148 bytes {5} [built]
    [1184] multi ./public/vendor/jquery-ui/jquery-ui.min.css ./public/vendor/codemirror-spell-checker/spell-checker.min.css ./node_modules/@hackmd/codemirror/lib/codemirror.css ./node_modules/@hackmd/codemirror/addon/fold/foldgutter.css ./node_modules/@hackmd/codemirror/addon/display/fullscreen.css ./node_modules/@hackmd/codemirror/addon/dialog/dialog.css ./node_modules/@hackmd/codemirror/addon/scroll/simplescrollbars.css ./node_modules/@hackmd/codemirror/addon/search/matchesonscrollbar.css ./node_modules/@hackmd/codemirror/theme/monokai.css ./node_modules/@hackmd/codemirror/theme/one-dark.css ./node_modules/@hackmd/codemirror/theme/dracula.css ./node_modules/@hackmd/codemirror/theme/material.css ./node_modules/@hackmd/codemirror/theme/nord.css ./node_modules/@hackmd/codemirror/theme/panda-syntax.css ./node_modules/@hackmd/codemirror/theme/solarized.css ./public/css/codemirror-extend/ayu-dark.css ./public/css/codemirror-extend/ayu-mirage.css ./public/css/codemirror-extend/tomorrow-night-bright.css ./public/css/codemirror-extend/tomorrow-night-eighties.css ./node_modules/@hackmd/codemirror/mode/tiddlywiki/tiddlywiki.css ./node_modules/@hackmd/codemirror/mode/mediawiki/mediawiki.css ./public/css/github-extract.css ./public/vendor/showup/showup.css ./public/css/mermaid.css ./public/css/markdown.css ./public/css/slide-preview.css 328 bytes {7} [built]
    [1207] multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./public/css/bootstrap-social.css ./node_modules/ionicons/css/ionicons.min.css ./node_modules/leaflet/dist/leaflet.css 64 bytes {8} [built]
    [1208] multi babel-polyfill script-loader!jquery-ui-resizable bootstrap-validator expose-loader?jsyaml!js-yaml script-loader!mermaid expose-loader?moment!moment script-loader!handlebars expose-loader?hljs!highlight.js emojify.js script-loader!gist-embed script-loader!codemirror script-loader!inlineAttachment script-loader!jqueryTextcomplete script-loader!codemirrorInlineAttachment script-loader!ot flowchart.js imports-loader?Raphael=raphael!js-sequence-diagrams script-loader!viz.js script-loader!viz.render.js script-loader!abcjs script-loader!vega script-loader!vega-lite script-loader!vega-embed expose-loader?io!socket.io-client expose-loader?RevealMarkdown!reveal-markdown expose-loader?L!leaflet ./public/js/index.js 340 bytes {6} [built]
    [1237] multi babel-polyfill flowchart.js imports-loader?Raphael=raphael!js-sequence-diagrams expose-loader?RevealMarkdown!reveal-markdown ./public/js/pretty.js 76 bytes {9} [built]
    [1238] multi ./public/css/github-extract.css ./public/css/mermaid.css ./public/css/markdown.css ./public/css/slide-preview.css 64 bytes {11} [built]
    [1239] multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./node_modules/ionicons/css/ionicons.min.css ./node_modules/leaflet/dist/leaflet.css 52 bytes {12} [built]
    [1240] multi babel-polyfill expose-loader?jsyaml!js-yaml script-loader!mermaid expose-loader?moment!moment script-loader!handlebars expose-loader?hljs!highlight.js emojify.js script-loader!gist-embed flowchart.js imports-loader?Raphael=raphael!js-sequence-diagrams script-loader!viz.js script-loader!viz.render.js script-loader!abcjs script-loader!vega script-loader!vega-lite script-loader!vega-embed expose-loader?RevealMarkdown!reveal-markdown expose-loader?L!leaflet ./public/js/pretty.js 244 bytes {10} [built]
    [1241] multi babel-polyfill bootstrap-tooltip flowchart.js imports-loader?Raphael=raphael!js-sequence-diagrams expose-loader?RevealMarkdown!reveal-markdown ./public/js/slide.js 88 bytes {13} [built]
    [1242] multi ./public/vendor/bootstrap/tooltip.min.css ./public/css/github-extract.css ./public/css/mermaid.css ./public/css/markdown.css 64 bytes {15} [built]
        + 1278 hidden modules

    WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
    This can impact web performance.
    Assets:
      28df6ee7b407fd8a14b40bc01f4fd3ae.svg (326 KiB)
      cover-pack.97360d007dee48c4aeb4.js (498 KiB)
      index.880265080eea349dc10d.js (2.33 MiB)
      index-pack.1d373d2f34f0ffe69255.js (8.05 MiB)
      pretty.5f033c71b7bd43182307.js (1.07 MiB)
      pretty-pack.be9045fb2df8d5a6a88b.js (6.71 MiB)
      slide.01fe49f7e11b6ad268ad.js (1.08 MiB)
      slide-pack.1ef8e5f358776493856b.js (6.9 MiB)
      leaflet/leaflet-src.js (399 KiB)
      reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf (278 KiB)
      reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf (281 KiB)
      MathJax/config/TeX-MML-AM_HTMLorMML.js (278 KiB)
      MathJax/config/MML_HTMLorMML-full.js (274 KiB)
      MathJax/config/TeX-MML-AM_CHTML.js (274 KiB)
      MathJax/config/TeX-AMS_SVG-full.js (275 KiB)
      MathJax/config/TeX-MML-AM_SVG.js (274 KiB)
      MathJax/config/TeX-AMS_CHTML-full.js (283 KiB)
      leaflet/leaflet-src.esm.js (398 KiB)
      MathJax/config/AM_HTMLorMML-full.js (292 KiB)
      MathJax/config/TeX-AMS-MML_SVG-full.js (296 KiB)
      MathJax/config/TeX-AMS_HTML-full.js (307 KiB)
      MathJax/config/TeX-MML-AM_SVG-full.js (334 KiB)
      MathJax/config/TeX-MML-AM_CHTML-full.js (342 KiB)
      fork-awesome/fonts/forkawesome-webfont.svg (470 KiB)
      MathJax/config/Accessible-full.js (356 KiB)
      MathJax/config/TeX-AMS-MML_HTMLorMML-full.js (356 KiB)
      MathJax/config/TeX-MML-AM_HTMLorMML-full.js (395 KiB)
      MathJax/fonts/HTML-CSS/Gyre-Pagella/eot/GyrePagellaMathJax_NonUnicode-Regular.eot (248 KiB)
      dictionary-en-gb/index.dic (539 KiB)
      MathJax/extensions/a11y/mathjax-sre.js (474 KiB)
      MathJax/fonts/HTML-CSS/Latin-Modern/otf/LatinModernMathJax_NonUnicode-Regular.otf (312 KiB)
      reveal.js/plugin/highlight/highlight.js (724 KiB)
      MathJax/fonts/HTML-CSS/Latin-Modern/eot/LatinModernMathJax_NonUnicode-Regular.eot (377 KiB)
      MathJax/extensions/a11y/mathmaps/mathmaps_ie.js (887 KiB)
      dictionary-de/index.dic (1.06 MiB)
      dictionary-de-ch/index.dic (1.07 MiB)
      dictionary-de-at/index.dic (1.07 MiB)
      MathJax/jax/output/SVG/fonts/Gyre-Termes/NonUnicode/Regular/Main.js (559 KiB)
      MathJax/jax/output/SVG/fonts/Neo-Euler/NonUnicode/Regular/Main.js (538 KiB)
      MathJax/jax/output/SVG/fonts/Gyre-Pagella/NonUnicode/Regular/Main.js (610 KiB)
      MathJax/unpacked/extensions/a11y/mathjax-sre.js (474 KiB)
      MathJax/jax/output/SVG/fonts/Latin-Modern/NonUnicode/Regular/Main.js (961 KiB)
      MathJax/unpacked/extensions/a11y/mathmaps/mathmaps_ie.js (887 KiB)
      MathJax/unpacked/jax/output/SVG/fonts/Gyre-Termes/NonUnicode/Regular/Main.js (566 KiB)
      MathJax/unpacked/jax/output/SVG/fonts/Neo-Euler/NonUnicode/Regular/Main.js (544 KiB)
      MathJax/unpacked/jax/output/SVG/fonts/Gyre-Pagella/NonUnicode/Regular/Main.js (618 KiB)
      MathJax/unpacked/jax/output/SVG/fonts/Latin-Modern/NonUnicode/Regular/Main.js (971 KiB)
      emojify.js/dist/css/data-uri/emojify.css (7.24 MiB)
      emojify.js/dist/css/data-uri/emojify.min.css (7.21 MiB)

    WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
    Entrypoints:
      cover-pack (506 KiB)
          cover-pack.css
          cover-pack.97360d007dee48c4aeb4.js
      index (2.37 MiB)
          index.css
          index.880265080eea349dc10d.js
      index-pack (8.08 MiB)
          index-pack.css
          index-pack.1d373d2f34f0ffe69255.js
      pretty (1.09 MiB)
          pretty.css
          pretty.5f033c71b7bd43182307.js
      pretty-pack (6.73 MiB)
          pretty-pack.css
          pretty-pack.be9045fb2df8d5a6a88b.js
      slide (1.1 MiB)
          slide.css
          slide.01fe49f7e11b6ad268ad.js
      slide-pack (6.92 MiB)
          slide-pack.css
          slide-pack.1ef8e5f358776493856b.js


    WARNING in webpack performance recommendations:
    You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
    For more info visit https://webpack.js.org/guides/code-splitting/
    Child HtmlWebpackCompiler:
        Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
        Entrypoint HtmlWebpackPlugin_1 = __child-HtmlWebpackPlugin_1
        [0] ./node_modules/html-webpack-plugin/lib/loader.js!./public/views/includes/header.ejs 560 bytes {0} [built]
        [1] ./node_modules/html-webpack-plugin/lib/loader.js!./public/views/includes/scripts.ejs 661 bytes {1} [built]
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/dialog/dialog.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/display/fullscreen.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/fold/foldgutter.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/hint/show-hint.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/scroll/simplescrollbars.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/addon/search/matchesonscrollbar.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/lib/codemirror.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/mode/mediawiki/mediawiki.css:
        Entrypoint mini-css-extract-plugin = *
           9 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/mode/tiddlywiki/tiddlywiki.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/dracula.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/material.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/monokai.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/nord.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/one-dark.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/panda-syntax.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/@hackmd/codemirror/theme/solarized.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/bootstrap/dist/css/bootstrap.min.css:
        Entrypoint mini-css-extract-plugin = *
           8 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/highlight.js/styles/github-gist.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/ionicons/css/ionicons.min.css:
        Entrypoint mini-css-extract-plugin = *
           7 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/leaflet/dist/leaflet.css:
        Entrypoint mini-css-extract-plugin = *
           6 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/prismjs/themes/prism.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/select2/select2-bootstrap.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/select2/select2.css:
        Entrypoint mini-css-extract-plugin = *
           6 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/spin.js/spin.css:
        Entrypoint mini-css-extract-plugin = *
           2 modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/bootstrap-social.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/bootstrap-social.css 20.1 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/codemirror-extend/ayu-dark.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/codemirror-extend/ayu-dark.css 2.39 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/codemirror-extend/ayu-mirage.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/codemirror-extend/ayu-mirage.css 2.5 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/codemirror-extend/tomorrow-night-bright.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/codemirror-extend/tomorrow-night-bright.css 1.92 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/codemirror-extend/tomorrow-night-eighties.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/codemirror-extend/tomorrow-night-eighties.css 2.58 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/cover.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/cover.css 8.14 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/extra.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/extra.css 9.94 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/github-extract.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/github-extract.css 10.4 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/google-font.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/google-font.css 377 bytes {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/index.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/index.css 13.7 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/markdown.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/markdown.css 4.74 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/mermaid.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/mermaid.css 5.37 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/site.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/site.css 918 bytes {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/slide-preview.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/slide-preview.css 1.27 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/js/lib/renderer/fretboard/css/i.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/js/lib/renderer/fretboard/css/i.css 2.88 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/js/lib/renderer/lightbox/lightbox.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/js/lib/renderer/lightbox/lightbox.css 2.68 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/vendor/bootstrap/tooltip.min.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/vendor/bootstrap/tooltip.min.css 6.96 KiB {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/vendor/codemirror-spell-checker/spell-checker.min.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/vendor/codemirror-spell-checker/spell-checker.min.css 457 bytes {0} [built]
            + 1 hidden module
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/vendor/jquery-ui/jquery-ui.min.css:
        Entrypoint mini-css-extract-plugin = *
         [0] ./public/vendor/jquery-ui/images/ui-icons_222222_256x240.png 4.93 KiB {0} [built]
         [1] ./public/vendor/jquery-ui/images/ui-icons_454545_256x240.png 4.93 KiB {0} [built]
         [2] ./public/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png 157 bytes {0} [built]
         [3] ./node_modules/css-loader!./public/vendor/jquery-ui/jquery-ui.min.css 15.8 KiB {0} [built]
         [6] ./public/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png 141 bytes {0} [built]
         [7] ./public/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png 205 bytes {0} [built]
         [8] ./public/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png 213 bytes {0} [built]
         [9] ./public/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png 209 bytes {0} [built]
        [10] ./public/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png 141 bytes {0} [built]
        [11] ./public/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png 293 bytes {0} [built]
        [12] ./public/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png 293 bytes {0} [built]
        [13] ./public/vendor/jquery-ui/images/ui-icons_888888_256x240.png 4.93 KiB {0} [built]
        [14] ./public/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png 4.93 KiB {0} [built]
        [15] ./public/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png 4.93 KiB {0} [built]
            + 2 hidden modules
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/vendor/showup/showup.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/vendor/showup/showup.css 2.58 KiB {0} [built]
            + 1 hidden module
Child save-as-html:
    Child mini-css-extract-plugin node_modules/css-loader/index.js!public/css/extra.css:
        Entrypoint mini-css-extract-plugin = *
        [0] ./node_modules/css-loader!./public/css/extra.css 9.94 KiB {0} [built]
            + 1 hidden module
```


## DBのマイグレーションを実行

```shell=
node_modules/.bin/sequelize db:migrate
```

```shell=
$ node_modules/.bin/sequelize db:migrate
2021-04-29T10:15:21.930Z warn:  Neither 'domain' nor 'CMD_DOMAIN' is configured. This can cause issues with various components.
Hint: Make sure 'protocolUseSSL' and 'urlAddPort' or 'CMD_PROTOCOL_USESSL' and 'CMD_URL_ADDPORT' are configured properly.
2021-04-29T10:15:21.932Z warn:  Session secret not set. Using random generated one. Please set `sessionSecret` in your config.js file. All users will be logged out.

Sequelize CLI [Node: 10.19.0, CLI: 5.5.1, ORM: 5.21.3]

Loaded configuration file "config.js".
Executing (default): SELECT 1+1 AS result
Executing (default): SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_type LIKE '%TABLE' AND table_name != 'spatial_ref_sys';
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20150504155329-create-users: migrating =======
Executing (default): CREATE TABLE IF NOT EXISTS "Users" ("id" UUID , "profileid" VARCHAR(255) UNIQUE, "profile" TEXT, "history" TEXT, "createdAt" TIMESTAMP WITH TIME ZONE, "updatedAt" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20150504155329-create-users: migrated (0.022s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20150508114741-create-notes: migrating =======
Executing (default): CREATE TABLE IF NOT EXISTS "Notes" ("id" UUID , "ownerId" UUID, "content" TEXT, "title" VARCHAR(255), "createdAt" TIMESTAMP WITH TIME ZONE, "updatedAt" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20150508114741-create-notes: migrated (0.010s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20150515125813-create-temp: migrating =======
Executing (default): CREATE TABLE IF NOT EXISTS "Temp" ("id" VARCHAR(255) , "date" TEXT, "createdAt" TIMESTAMP WITH TIME ZONE, "updatedAt" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20150515125813-create-temp: migrated (0.010s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20150702001020-update-to-0_3_1: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "shortid" VARCHAR(255) NOT NULL DEFAULT '0000000000';
Executing (default): CREATE INDEX "notes_shortid" ON "Notes" ("shortid")
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "permission" VARCHAR(255) NOT NULL DEFAULT 'private';
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "viewcount" INTEGER DEFAULT 0;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20150702001020-update-to-0_3_1: migrated (0.013s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20150915153700-change-notes-title-to-text: migrating =======
Executing (default): ALTER TABLE "Notes" ALTER COLUMN "title" DROP NOT NULL;ALTER TABLE "Notes" ALTER COLUMN "title" DROP DEFAULT;ALTER TABLE "Notes" ALTER COLUMN "title" TYPE TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20150915153700-change-notes-title-to-text: migrated (0.028s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20160112220142-note-add-lastchange: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "lastchangeuserId" UUID;
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "lastchangeAt" TIMESTAMP WITH TIME ZONE;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20160112220142-note-add-lastchange: migrated (0.006s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20160420180355-note-add-alias: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "alias" VARCHAR(255);
Executing (default): CREATE INDEX "notes_alias" ON "Notes" ("alias")
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20160420180355-note-add-alias: migrated (0.018s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20160515114000-user-add-tokens: migrating =======
Executing (default): ALTER TABLE "public"."Users" ADD COLUMN "accessToken" VARCHAR(255);
Executing (default): ALTER TABLE "public"."Users" ADD COLUMN "refreshToken" VARCHAR(255);
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20160515114000-user-add-tokens: migrated (0.007s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20160607060246-support-revision: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "savedAt" TIMESTAMP WITH TIME ZONE;
Executing (default): CREATE TABLE IF NOT EXISTS "Revisions" ("id" UUID , "noteId" UUID, "patch" TEXT, "lastContent" TEXT, "content" TEXT, "length" INTEGER, "createdAt" TIMESTAMP WITH TIME ZONE, "updatedAt" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20160607060246-support-revision: migrated (0.016s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20160703062241-support-authorship: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "authorship" TEXT;
Executing (default): ALTER TABLE "public"."Revisions" ADD COLUMN "authorship" TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "Authors" ("id"  SERIAL , "color" VARCHAR(255), "noteId" UUID, "userId" UUID, "createdAt" TIMESTAMP WITH TIME ZONE, "updatedAt" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20160703062241-support-authorship: migrated (0.011s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20161009040430-support-delete-note: migrating =======
Executing (default): ALTER TABLE "public"."Notes" ADD COLUMN "deletedAt" TIMESTAMP WITH TIME ZONE;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20161009040430-support-delete-note: migrated (0.006s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20161201050312-support-email-signin: migrating =======
Executing (default): ALTER TABLE "public"."Users" ADD COLUMN "email" TEXT;
Executing (default): ALTER TABLE "public"."Users" ADD COLUMN "password" TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20161201050312-support-email-signin: migrated (0.008s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20171009121200-longtext-for-mysql: migrating =======
(sequelize) Warning: PostgreSQL does not support TEXT with options. Plain `TEXT` will be used instead.
>> Check: http://www.postgresql.org/docs/9.4/static/datatype.html
Executing (default): ALTER TABLE "Notes" ALTER COLUMN "content" DROP NOT NULL;ALTER TABLE "Notes" ALTER COLUMN "content" DROP DEFAULT;ALTER TABLE "Notes" ALTER COLUMN "content" TYPE TEXT;
Executing (default): ALTER TABLE "Revisions" ALTER COLUMN "patch" DROP NOT NULL;ALTER TABLE "Revisions" ALTER COLUMN "patch" DROP DEFAULT;ALTER TABLE "Revisions" ALTER COLUMN "patch" TYPE TEXT;
Executing (default): ALTER TABLE "Revisions" ALTER COLUMN "content" DROP NOT NULL;ALTER TABLE "Revisions" ALTER COLUMN "content" DROP DEFAULT;ALTER TABLE "Revisions" ALTER COLUMN "content" TYPE TEXT;
Executing (default): ALTER TABLE "Revisions" ALTER COLUMN "lastContent" DROP NOT NULL;ALTER TABLE "Revisions" ALTER COLUMN "lastContent" DROP DEFAULT;ALTER TABLE "Revisions" ALTER COLUMN "lastContent" TYPE TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20171009121200-longtext-for-mysql: migrated (0.010s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20180209120907-longtext-of-authorship: migrating =======
Executing (default): ALTER TABLE "Notes" ALTER COLUMN "authorship" DROP NOT NULL;ALTER TABLE "Notes" ALTER COLUMN "authorship" DROP DEFAULT;ALTER TABLE "Notes" ALTER COLUMN "authorship" TYPE TEXT;
Executing (default): ALTER TABLE "Revisions" ALTER COLUMN "authorship" DROP NOT NULL;ALTER TABLE "Revisions" ALTER COLUMN "authorship" DROP DEFAULT;ALTER TABLE "Revisions" ALTER COLUMN "authorship" TYPE TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20180209120907-longtext-of-authorship: migrated (0.007s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20180306150303-fix-enum: migrating =======
Executing (default): ALTER TABLE "Notes" ALTER COLUMN "permission" DROP NOT NULL;ALTER TABLE "Notes" ALTER COLUMN "permission" DROP DEFAULT;CREATE TYPE "public"."enum_Notes_permission" AS ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private');ALTER TABLE "Notes" ALTER COLUMN "permission" TYPE "public"."enum_Notes_permission" USING ("permission"::"public"."enum_Notes_permission");
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20180306150303-fix-enum: migrated (0.017s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20180326103000-use-text-in-tokens: migrating =======
Executing (default): ALTER TABLE "Users" ALTER COLUMN "accessToken" DROP NOT NULL;ALTER TABLE "Users" ALTER COLUMN "accessToken" DROP DEFAULT;ALTER TABLE "Users" ALTER COLUMN "accessToken" TYPE TEXT;
Executing (default): ALTER TABLE "Users" ALTER COLUMN "refreshToken" DROP NOT NULL;ALTER TABLE "Users" ALTER COLUMN "refreshToken" DROP DEFAULT;ALTER TABLE "Users" ALTER COLUMN "refreshToken" TYPE TEXT;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20180326103000-use-text-in-tokens: migrated (0.009s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20180525153000-user-add-delete-token: migrating =======
Executing (default): ALTER TABLE "public"."Users" ADD COLUMN "deleteToken" UUID;
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20180525153000-user-add-delete-token: migrated (0.005s)

Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): SELECT "name" FROM "SequelizeMeta" AS "SequelizeMeta" ORDER BY "SequelizeMeta"."name" ASC;
== 20200104215332-remove-temp-table: migrating =======
Executing (default): DROP TABLE IF EXISTS "Temp";
Executing (default): CREATE TABLE IF NOT EXISTS "SequelizeMeta" ("name" VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY ("name"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'SequelizeMeta' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Executing (default): INSERT INTO "SequelizeMeta" ("name") VALUES ($1) RETURNING *;
== 20200104215332-remove-temp-table: migrated (0.005s)
```


## CodiMDを起動

通常の起動方法
```shell=
node app.js
```

開発用に起動
```shell=
NODE_ENV='development' node app.js
```

本番用に起動
```shell=
NODE_ENV='production' node app.js
```


※sqliteを使用する場合に以下のエラーが出たら、sqliteをインストール
```log=
2021-04-28T01:25:20.440Z warn:  Neither 'domain' nor 'CMD_DOMAIN' is configured. This can cause issues with various components.
Hint: Make sure 'protocolUseSSL' and 'urlAddPort' or 'CMD_PROTOCOL_USESSL' and 'CMD_URL_ADDPORT' are configured properly.
2021-04-28T01:25:20.442Z warn:  Session secret not set. Using random generated one. Please set `sessionSecret` in your config.js file. All users will be logged out.
2021-04-28T01:25:20.585Z error:         uncaughtException: Please install sqlite3 package manually
Error: Please install sqlite3 package manually
```

```shell=
npm install sqlite3
```

## HackMD の動作確認

`http://ip_address:3000`にアクセスし、HackMDが使用出来ればOK。
![](https://i.imgur.com/zoRAnbr.png)



###### tags: `CodiMD` `Docker` `HackMD` `Ubuntu`
