add an account-name field to site-watcher

db4
Doug Coleman 2009-03-18 18:18:57 -05:00
parent 87997cc0d2
commit 33914c62cb
3 changed files with 8 additions and 6 deletions

View File

@ -5,14 +5,15 @@ io.directories io.files.temp kernel io.streams.string calendar
debugger combinators.smart sequences ;
IN: site-watcher.db
TUPLE: account account-id email ;
TUPLE: account account-id account-name email ;
: <account> ( email -- account )
: <account> ( account-name -- account )
account new
swap >>email ;
swap >>account-name ;
account "ACCOUNT" {
{ "account-id" "ACCOUNT_ID" +db-assigned-id+ }
{ "account-name" "ACCOUNT_NAME" VARCHAR }
{ "email" "EMAIL" VARCHAR }
} define-persistent
@ -74,7 +75,7 @@ TUPLE: reporting-site email url up? changed? last-up? error last-error ;
dup t >>up? insert-tuple
] unless ;
: insert-account ( email -- ) <account> insert-tuple ;
: insert-account ( account-name -- ) <account> insert-tuple ;
: find-sites ( -- seq ) f <site> select-tuples ;

View File

@ -1,7 +1,8 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: db.tuples locals site-watcher site-watcher.db
site-watcher.private kernel ;
site-watcher.private kernel db io.directories io.files.temp
continuations ;
IN: site-watcher.tests
: site-watcher-path ( -- path ) "site-watcher.db" temp-file ; inline

View File

@ -3,7 +3,7 @@
USING: accessors alarms arrays calendar combinators
combinators.smart continuations debugger http.client
init io.streams.string kernel locals math math.parser
namespaces sequences site-watcher.db smtp ;
namespaces sequences site-watcher.db site-watcher.db.private smtp ;
IN: site-watcher
SYMBOL: site-watcher-from