17 lines
714 B
SQL
17 lines
714 B
SQL
-- Run as an admin, before the app starts.
|
|
-- Do not create a remote root, and do not grant this user '@'%'.
|
|
-- The app user cannot DELETE and cannot apply DDL.
|
|
-- Soft-delete is an UPDATE of deleted_at.
|
|
-- Replace the password, then: chmod 600 this file if you fill in a real password.
|
|
|
|
CREATE DATABASE IF NOT EXISTS hundredkmph CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
|
|
CREATE USER IF NOT EXISTS 'hundredkmph'@'localhost' IDENTIFIED BY 'replace-with-a-long-random-password';
|
|
|
|
GRANT SELECT, INSERT, UPDATE ON hundredkmph.* TO 'hundredkmph'@'localhost';
|
|
|
|
FLUSH PRIVILEGES;
|
|
|
|
-- Then apply the migration as an admin (the app user cannot):
|
|
-- mariadb hundredkmph < /opt/hundredkmph/src/web/db/001_init.sql
|