apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-initdb-config
  namespace: mysql
  labels:
    app: mysql
data:
  initdb.sql: |
    CREATE TABLE IF NOT EXISTS test (
      id serial NOT NULL PRIMARY KEY,
      name varchar(100),
      email varchar(200),
      department varchar(200),
      modified timestamp default CURRENT_TIMESTAMP NOT NULL,
      INDEX `modified_index` (`modified`)
    );

    INSERT INTO test (name, email, department) VALUES ('alice', 'alice@abc.com', 'engineering');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');
    INSERT INTO test (name, email, department) VALUES ('bob', 'bob@abc.com', 'sales');