Skip to content

Commit 04a4018

Browse files
committed
add an example database
Close #1
1 parent e09b917 commit 04a4018

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Well... Here we go then!
1717
## Installation
1818
In order to have a configuration file copy the `.env.example` file and name it `.env`.
1919

20+
### Example API
21+
If you wanna use the example API, you will need to import the `sql/db.sql` script in a MySQL environment. Don't forget to connect PhRe-API with your database by configuring the credentials inside the `.env` file.
22+
2023
## Configuration
2124
Inside of the `.env`-file there are a few settings you might wanna check.
2225
You can for example specify which kinds of messages will be outputted and which ones will be suppressed.

sql/db.sql

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 5.1.1
3+
-- https://www.phpmyadmin.net/
4+
--
5+
-- Host: localhost:8889
6+
-- Erstellungszeit: 14. Apr 2022 um 20:39
7+
-- Server-Version: 5.7.34
8+
-- PHP-Version: 8.0.8
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
START TRANSACTION;
12+
SET time_zone = "+00:00";
13+
14+
15+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
16+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
17+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
18+
/*!40101 SET NAMES utf8mb4 */;
19+
20+
--
21+
-- Datenbank: `phre-api`
22+
--
23+
24+
-- --------------------------------------------------------
25+
26+
--
27+
-- Tabellenstruktur für Tabelle `user`
28+
--
29+
30+
CREATE TABLE `user` (
31+
`ID` int(11) NOT NULL,
32+
`username` varchar(100) NOT NULL,
33+
`password` varchar(255) NOT NULL
34+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35+
36+
--
37+
-- Daten für Tabelle `user`
38+
--
39+
40+
INSERT INTO `user` (`ID`, `username`, `password`) VALUES
41+
(1, 'test.user', 'I am a password ;)');
42+
43+
--
44+
-- Indizes der exportierten Tabellen
45+
--
46+
47+
--
48+
-- Indizes für die Tabelle `user`
49+
--
50+
ALTER TABLE `user`
51+
ADD PRIMARY KEY (`ID`);
52+
53+
--
54+
-- AUTO_INCREMENT für exportierte Tabellen
55+
--
56+
57+
--
58+
-- AUTO_INCREMENT für Tabelle `user`
59+
--
60+
ALTER TABLE `user`
61+
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
62+
COMMIT;
63+
64+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
65+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
66+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

0 commit comments

Comments
 (0)