First commit with code
This commit is contained in:
6
data/.gitignore
vendored
Normal file
6
data/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
*
|
||||
!.gitignore
|
||||
!.gitkeep
|
||||
!README
|
||||
!README.md
|
||||
!*.sql
|
||||
0
data/.gitkeep
Normal file
0
data/.gitkeep
Normal file
34
data/README.md
Normal file
34
data/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Readme for this data folder
|
||||
|
||||
This folder contains:
|
||||
1. The runtime database (SQLite) files - *.sqlite3
|
||||
1. The SQL scripts for database maintenance:
|
||||
|
||||
## Database Maintenance Scripts
|
||||
|
||||
|
||||
|
||||
| File | Description |
|
||||
|----|----|
|
||||
|`schema.sql`|Database schema
|
||||
|`create-sample-data.sql`|Insert sample rows to the users table
|
||||
|
||||
To run the sql script with SQLite3:
|
||||
```bash
|
||||
cat <sql script file> | sqlite3 <database file>
|
||||
```
|
||||
|
||||
|
||||
# Init the database
|
||||
|
||||
NOTE: The init script will remove all data. Please backup the data before performing the follow steps.
|
||||
|
||||
```bash
|
||||
cat ../src/main/resources/sqlite/schema.sql | sqlite3 mainapp.sqlite3
|
||||
```
|
||||
|
||||
# Create sample data
|
||||
|
||||
```bash
|
||||
cat ../src/main/resources/sqlite/create-sample-data.sql | sqlite3 mainapp.sqlite3
|
||||
```
|
||||
Reference in New Issue
Block a user