NAME

bif-sql-func-new-project - add a new project to an update

VERSION

0.1.0 (yyyy-mm-dd)

SYNOPSIS

#!sqlite
BEGIN;

INSERT INTO updates(...);

INSERT INTO func_new_project(
    update_id,  -- integer NOT NULL DEFAULT (currval('updates')),
    id,         -- integer NOT NULL DEFAULT (nextval('topics')),
    parent_id,  -- integer,
    name,       -- varchar(40),
    title       -- varchar(1024) NOT NULL DEFAULT ''
) VALUES (...);

INSERT INTO func_new_project_status(...);

INSERT INTO func_update_project(...);

INSERT INTO func_merge_updates(...);

COMMIT;

DESCRIPTION

func_new_project() adds a new project to an in-progress update by inserting a row into each of the topics and projects tables.

The transaction will fail with a foreign key violation unless at least one call to func_new_project_status() is also made and a row is inserted into project_updates resulting in projects.status_id having a valid value.

AFFECTED TABLES

A successful call to func_new_project directly affects the following tables:

SEE ALSO

bif-sql-table-updates, bif-sql-table-topics, bif-sql-table-projects, bif-sql-func-new-project-status, bif-sql-table-project-updates, bif-sql-func-merge-updates

AUTHOR

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE

Copyright 2013-2014 Mark Lawrence <nomad@null.net>

This program 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 3 of the License, or (at your option) any later version.