Browse Source

current schema

master
Brennen Bearnes 2 years ago
parent
commit
fb8be75add
1 changed files with 24 additions and 9 deletions
  1. +24
    -9
      lib/App/Pieces.pm

+ 24
- 9
lib/App/Pieces.pm View File

@ -102,22 +102,27 @@ sub create_pieces_db {
my ($self) = shift;
my ($dbh) = @_;
$dbh->do(q{
CREATE TABLE pieces (
# We'll stash what version of pieces created the schema, and when:
$dbh->do(qq{
CREATE TABLE schema_version (
id integer primary key,
address text,
created text
version text DEFAULT '$VERSION',
created text DEFAULT CURRENT_TIMESTAMP
);
});
$dbh->do(q{ INSERT INTO schema_version DEFAULT VALUES; });
$dbh->do(q{
CREATE TABLE schema_version (
CREATE TABLE pieces (
id integer primary key,
version text,
created text
address text,
created text,
modified text
);
});
$dbh->do(q{
CREATE TABLE links (
id integer primary key,
@ -127,6 +132,16 @@ sub create_pieces_db {
created text
);
});
$dbh->do(q{
CREATE TABLE groups (
id integer primary key,
name text,
description text,
created text,
modifed text
);
});
}
=item add(@addresses)
@ -187,7 +202,7 @@ sub get_or_add {
# If we didn't find an existing piece, add it and get its id
if (! defined $id) {
($id) = add($addy);
($id) = $self->add($addy);
}
return $id;
@ -267,7 +282,7 @@ sub foreach_row {
Copyright 2018 Brennen Bearnes
mark is free software; you can redistribute it and/or modify
pieces is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.


Loading…
Cancel
Save