commit 874d8bb608f0adb88bd2db3cc54df6cc43eb89ec
Author: David Engel <david@absentmindedproductions.ca>
Date: Sat, 23 May 2015 23:45:05 -0400
initial
Diffstat:
A | sl | | | 30 | ++++++++++++++++++++++++++++++ |
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/sl b/sl
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+
+use warnings
+use strict
+
+use DBI;
+
+my $dbh = DBI->connect(
+ "dbi:SQLite:dbname=db",
+ "",
+ "",
+ { RaiseError => 1 }
+) or die $DBI::errstr;
+
+$dbh->do(qq{create table if not exists contacts(
+ phone_num int not null primary key,
+ name text not null)
+}) or die $DBI::errstr;
+
+$dbh->do(qq{create table if not exists list_data(
+ list_id int not null,
+ position int not null,
+ text text not null,
+ status int not null default 0,
+ owner int not null,
+ primary key(list_id, position),
+ foreign key(owner) references contacts(phone_num)
+)}) or die $DBI::errstr;
+
+$dbh->do(qq{create table if not exists user_list(