Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PaymentServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
PaymentServer
Commits
038dc644
Commit
038dc644
authored
5 years ago
by
Ramakrishnan Muthukrishnan
Browse files
Options
Downloads
Patches
Plain Diff
enable foreign keys as sqlite default is to turn it off
parent
10187d9f
Branches
Branches containing commit
No related tags found
1 merge request
!26
Initial implementation of Persistence using sqlite
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PaymentServer/Persistence.hs
+1
-0
1 addition, 0 deletions
src/PaymentServer/Persistence.hs
with
1 addition
and
0 deletions
src/PaymentServer/Persistence.hs
+
1
−
0
View file @
038dc644
...
...
@@ -153,6 +153,7 @@ insertVoucherAndFingerprint dbConn voucher fingerprint =
getDBConnection
::
Text
->
IO
VoucherDatabaseState
getDBConnection
name
=
do
dbConn
<-
Sqlite
.
open
(
unpack
name
)
Sqlite
.
execute_
dbConn
"PRAGMA foreign_keys = ON"
Sqlite
.
execute_
dbConn
"CREATE TABLE IF NOT EXISTS vouchers (id INTEGER PRIMARY KEY, name TEXT UNIQUE)"
Sqlite
.
execute_
dbConn
"CREATE TABLE IF NOT EXISTS redeemed (id INTEGER PRIMARY KEY, voucher_id INTEGER, fingerprint TEXT, FOREIGN KEY (voucher_id) REFERENCES vouchers(id))"
return
$
SQLiteDB
dbConn
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment