NAME
bif-doc-func-new-project - add a new project to an update
VERSION
0.1.0_19 (2014-05-08)
SYNOPSIS
#!sqlite
BEGIN;
INSERT INTO updates(...);
INSERT INTO func_new_project(
update_id, -- integer NOT NULL,
id, -- integer NOT NULL,
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
The func_new_project() function creates a new project in the repository against an in-progress update #1 by taking the following actions:
A row is inserted into the topics table with a SHA1 hash of the values resulting in the project/topic UUID.
A row is inserted into the projects table.
Update #2 is started by inserting a new row into the updates table.
A row is inserted into hub_updates against update #2 for the local hub with project_id set to topics.id / projects.id, which kicks of the following trigger actions:
A row is inserted into hub_related_projects connecting the project to the local hub.
A row is inserted into hub_related_updates connecting the update to the local hub, which kicks off the following trigger actions:
A row is inserted into hubs_merkle taking into account the new update #2.
A row is inserted into hub_tomerge but probably keeps zero values.
A row is inserted into project_updates against update #1, which kicks off the following trigger actions:
A row is inserted into projects_tomerge.
A row is inserted into project_related_updates connecting update #1 to the project, which kicks off the following trigger actions:
A row is inserted into projects_merkle taking into account the new update #1.
If project_update.hub_uuid exists in the repository then every project-only update from project_related_updates is added to hub_related_updates
The enclosing 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
containing a valid foreign key value into the project_status table.
SEE ALSO
bif-doc-table-updates, bif-doc-table-topics, bif-doc-table-projects, bif-doc-func-new-project-status, bif-doc-table-project-updates, bif-doc-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.