Skip to content

Commit 478bf6a

Browse files
committed
Set database collation to utf8, fix seed entries & readme description
1 parent 1e74b48 commit 478bf6a

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ To run the Docker version, follow these steps:
107107
and open the directory in the console. Then run `git clone https://github.com/Human-Connection/Clock-of-Change-API.git` to clone the repository to this directory.
108108
2. Go to the newly created Clock-of-Change-API directory (`cd Clock-of-Change-API` in the console)
109109
3. Run `docker-compose up`. This will build the Docker container on first startup and run it. This can take a while, but after some time you should see the Clock of Change ticking.
110-
4. To create an initial API key and sample entries, run `docker-compose exec db seed.sh`. The initial API key you can use with your requests will have the value `secret`.
110+
4. To create an initial API key and sample entries, run `docker-compose exec db bash seed.sh`. The initial API key you can use with your requests will have the value `secret`.
111111

112112
Now the Clock of Change API server is ready for usage at [http://127.0.0.1:1337](http://127.0.0.1:1337)
113113

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
MYSQL_PASSWORD: 123456
1414
ports:
1515
- 3306:3306
16+
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
1617

1718
mailhog:
1819
container_name: mailhog

seed.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
mysql --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DATABASE << EOF
3-
INSERT INTO \`clock_of_change\`.\`apikeys\` (\`secret\`, \`valid\`) VALUES ('secret', '1');
4-
INSERT INTO \`clock_of_change\`.\`entries\` (\`firstname\`, \`lastname\`, \`email\`, \`country\`, \`message\`, \`confirm_key\`, \`beta\`, \`newsletter\`, \`pax\`, \`email_confirmed\`, \`status\`) VALUES ('Pamela', 'Musterfrau', 'pamela@example.org', 'US', 'Let us change the world!', 'confirm', '1', '0', '1', '1', '1');
5-
INSERT INTO \`clock_of_change\`.\`entries\` (\`firstname\`, \`lastname\`, \`email\`, \`country\`, \`message\`, \`confirm_key\`, \`beta\`, \`newsletter\`, \`pax\`, \`email_confirmed\`, \`status\`) VALUES ('Max', 'Mustermann', 'max@example.org', 'DE', 'Lasst uns die Welt verbessern!', 'confirm', '0', '1', '1', '1', '1');
3+
INSERT INTO \`clock_of_change\`.\`apikeys\` (\`secret\`, \`valid\`, \`expire_at\`, \`created_at\`, \`updated_at\`) VALUES ('secret', '1', 1893456001, 1552060594, 1552060594);
4+
INSERT INTO \`clock_of_change\`.\`entries\` (\`email\`, \`firstname\`, \`lastname\`, \`message\`, \`country\`, \`image\`, \`email_confirmed\`, \`confirm_key\`, \`status\`, \`created_at\`, \`updated_at\`, \`confirmed_at\`, \`newsletter\`, \`pax\`) VALUES ('pamela@example.org', 'Pamela', 'Musterfrau', 'Let us change the world!', 'US', '', '1', 'confirm', '1', '1552060594', '1552060594', '1552060594', '1', '1');
5+
INSERT INTO \`clock_of_change\`.\`entries\` (\`email\`, \`firstname\`, \`lastname\`, \`message\`, \`country\`, \`image\`, \`email_confirmed\`, \`confirm_key\`, \`status\`, \`created_at\`, \`updated_at\`, \`confirmed_at\`, \`newsletter\`, \`pax\`) VALUES ('max@example.org', 'Max', 'Mustermann', 'Lasst uns die Welt verbessern!', 'DE', '', '1', 'confirm', '1', '1552060594', '1552060594', '1552060594', '0', '1');
66
EOF

0 commit comments

Comments
 (0)