NAME
bif-doc-func-new-project - add a new project to an change
VERSION
0.1.5_5 (2015-08-13)
SYNOPSIS
BEGIN;
INSERT INTO changes(...);
INSERT INTO func_new_project(
change_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_changes(...);
COMMIT;
DESCRIPTION
The func_new_project() function creates a new project in the repository against an in-progress change #1 by taking the following actions:
A row is inserted into the nodes table with a SHA1 hash of the values resulting in the project/node UUID.
A row is inserted into the projects table.
Change #2 is started by inserting a new row into the changes table.
A row is inserted into hub_deltas against change #2 for the local hub with project_id set to nodes.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_changes connecting the change to the local hub, which kicks off the following trigger actions:
A row is inserted into hub_related_changes_merkle taking into account the new change #2.
A row is inserted into hubs_tomerge but probably keeps zero values.
A row is inserted into project_deltas against change #1, which kicks off the following trigger actions:
A row is inserted into projects_tomerge.
A row is inserted into project_changes connecting change #1 to the project, which kicks off the following trigger actions:
A row is inserted into project_changes taking into account the new change #1.
If project_delta.hub_uuid exists in the repository then every project-only change from project_changes is added to hub_related_changes
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_deltas resulting in projects.project_status_id
containing a valid foreign key value into the project_status table.
SEE ALSO
bif-doc-table-changes, bif-doc-table-nodes, bif-doc-table-projects, bif-doc-func-new-project-status, bif-doc-table-project-changes, bif-doc-func-merge-changes
AUTHOR
Mark Lawrence <nomad@null.net>
COPYRIGHT AND LICENSE
Copyright 2013-2015 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.