apiVersion: v1
kind: ConfigMap
metadata:
  name: mariadb-initdb
  namespace: trojan
  labels:
    environment: production
    app: mariadb
data:
  initdb: |
    CREATE TABLE users (
        id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        username VARCHAR(64) NOT NULL,
        password CHAR(56) NOT NULL,
        quota BIGINT NOT NULL DEFAULT 0,
        download BIGINT UNSIGNED NOT NULL DEFAULT 0,
        upload BIGINT UNSIGNED NOT NULL DEFAULT 0,
        PRIMARY KEY (id),
        INDEX (password)
    );
