thumb text[],
wptitle text,
created timestamptz DEFAULT now(),
+ creator integer REFERENCES login (id),
+ updated timestamptz,
id serial NOT NULL PRIMARY KEY
);
COMMENT ON COLUMN word.source IS 'URI of downloaded image';
COMMENT ON COLUMN word.thumb IS 'ImageMagick convert options to create thumbnail from source image';
COMMENT ON COLUMN word.wptitle IS 'reference Wikipedia article';
+COMMENT ON COLUMN word.updated IS 'last significant change';
+COMMENT ON COLUMN word.creator IS 'user responsible for initial submit';
CREATE OR REPLACE FUNCTION exportform(word) RETURNS text AS $$
SELECT concat(
eval {
my %res = (returning => '*');
+ $row->{creator} = $user->{id} unless $find;
+ $row->{updated} = ['now()'];
my $query = $find ? $db->update(word => $row, $find, \%res) :
$db->insert(word => $row, \%res);
$row = $query->hash;