Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deleted old *.use files. Removed -t option to bric_pgimport.

  • Loading branch information...
commit 0b7e771c885c14001dea2ba4964fe22d6ff65325 1 parent 40b9908
@theory theory authored
View
11 bin/bric_pgimport
@@ -79,7 +79,7 @@ User name to which permissions should be granted on the new database.
=item -t
-If true, insert database test values.
+Deprecated.
=item -h
@@ -136,7 +136,7 @@ our ($opt_u, $opt_p, $opt_d, $opt_w, $opt_H, $opt_t, $opt_h, $opt_r, $opt_o,
getopts('u:p:d:w:H:o:m:htrcqg:P:');
-use vars qw( @SQL @CON @VAL @TST $STOP );
+use vars qw( @SQL @CON @VAL $STOP );
our $PSQL = $opt_P || 'psql';
@@ -159,11 +159,6 @@ insert_file_set(\@SQL);
print "\nPrepopulating tables with default values...\n" unless $opt_q;
insert_file_set(\@VAL);
-if ($opt_t) {
- print "\nPrepopulating tables with test values...\n" unless $opt_q;
- insert_file_set(\@TST);
-}
-
print "\nAdding constraints...\n" unless $opt_q;
insert_file_set(\@CON);
@@ -236,7 +231,6 @@ sub initialize {
@SQL = reverse `find $opt_w -name '*.sql'`;
@CON = reverse `find $opt_w -name '*.con'`;
@VAL = reverse `find $opt_w -name '*.val'`;
- @TST = reverse `find $opt_w -name '*.tst'` if $opt_t;
}
#------------------------------------------------------------------------------#
@@ -266,7 +260,6 @@ Supported Options:
Permissions will be granted to this user to access the new database
(assumes -g for this user).
-g User name to which permissions should be granted on the new database.
- -t If true, insert database test values.
-h Print this help message.
-q Quiet mode.
};
View
9 lib/Bric/Changes.pod
@@ -93,6 +93,15 @@ Orrock]
Added the "Remove Frameset" click-through on control bar next to "Repreview"
link in the preview window. [Paul Orrock]
+=item *
+
+Deleted all of the outdated and unused F<.use> files from F<sql/Pg>. [David]
+
+=item *
+
+Removed documentation of the C<-t> option of F<bric_pgimport>, which hasn't
+actually done anything for a long time, anyway. [David]
+
=back
=head2 Bug Fixes
View
48 sql/Pg/Bric/Biz/Contact.use
@@ -1,48 +0,0 @@
--- Project: Bricolage Business API
--- File: Contact.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-
-SELECT v.id, v.value, c.type, c.description, c.alertable, c.active
-FROM contact c, contact_value v
-WHERE c.id = v.contact__id
- AND v.id = 10;
-
-SELECT v.id, v.value, c.type, c.description, c.alertable, c.active
-FROM contact c, contact_value v
-WHERE c.id = v.contact__id
- AND LOWER(c.type) LIKE '%phone%';
-
-SELECT v.id, v.value, c.type, c.description, c.alertable, c.active
-FROM contact c, contact_value v
-WHERE c.id = v.contact__id
- AND LOWER(c.type) LIKE 'mobile phone'
- AND LOWER(v.value) LIKE '(415)%';
-
-INSERT INTO contact (id, type, description, alertable, active)
-VALUES (seq_contact.NextVal, 'Smoke Signals', NULL, 0, 1);
-
-INSERT INTO contact_value (id, value, contact__id)
-VALUES (seq_contact_value.NextVal, 'miraso@pacbell.net' , (
- SELECT id
- FROM contact
- WHERE LOWER(type) like 'email')
- );
-
-UPDATE contact
-SET id = 1,
- type = 'Lighthouse',
- description = 'NULL',
- active = 1,
- alertable = 0
-WHERE id = 1;
-
-UPDATE contact_value
-SET value = 'garth@perijove.com'
-WHERE id = 1;
-
-DELETE FROM contact_value
-WHERE id = 1;
View
21 sql/Pg/Bric/Biz/Org.use
@@ -1,21 +0,0 @@
--- Project: Bricolage Business API
--- File: Org.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT id, name, long_name, active
-FROM org
-WHERE id = 56;
-
-INSERT INTO org (id, name, long_name, active)
-VALUES (seq_org.NextVal, 'Kodak', 'Eastman Kodak Corporation', 1);
-
-UPDATE org
-SET id = 56,
- name = 'Kodak',
- long_name = 'Eastman Kodak Corporation',
- active = 1
-WHERE id = 56;
-
View
73 sql/Pg/Bric/Biz/Org/Parts/Addr.use
@@ -1,73 +0,0 @@
--- Project: Bricolage Business API
--- File: Address.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-CREATE TABLE person_org__addr(
- addr__id NUMBER(10, 0) NOT NULL,
- person_org__id NUMBER(10, 0) NOT NULL,
-
--- Select all the addresses for an organization.
-SELECT a.id, a.org__id, a.type, a.active, l.id, t.name, l.value
-FROM addr a, addr_line l, addr_line_type t
-WHERE a.id = addr__id
- AND t.id = l.addr_line_type__id
- AND org__id = 56;
-ORDER BY a.id, l.id;
-
--- Select all the addresses for a person in an organization.
-SELECT a.id, a.org__id, a.type, a.active, l.id, t.name, l.value
-FROM addr a, addr_line l, addr_line_type t, person_org__addr pa
-WHERE a.id = addr__id
- AND t.id = l.addr_line_type__id
- AND pa.addr_id = a.id
- AND pa.person_org__id = 212
-ORDER BY a.id, l.id;
-
--- Insert into addr.
-INSERT INTO addr (id, org__id, type, active)
-VALUES (seq_addr.NextVal, 56, 1);
-
--- Insert into addr_line.
-INSERT INTO addr_line (id, addr__id, addr_line_type__id, value)
-VALUES (seq_addr_line.NextVal, 68, 1, '22 Fourth Street, 16th Floor');
-
--- Insert into addr_line_type.
-INSERT INTO addr_line_type (id, name, active)
-VALUES (seq_addr_line_type.NextVal, 'province', 1);
-
-
--- Update addr.
-UPDATE addr
-SET id = 68,
- org__id = 56,
- type = 'SF Shipping',
- active = 1
-WHERE id = 68;
-
--- Update addr_line.
-UPDATE addr_line
-SET id = 102,
- addr__id = 68,
- addr_line_type__id = 1,
- value = '22 Fourth Street, 16th Floor'
-WHERE id = 102;
-
--- Update addr_line_type.
-UPDATE addr_line_type
-SET id = 3,
- name = 'state',
- active = 0
-WHERE id = 3;
-
--- Insert into person_org__addr.
-INSERT INTO person_org__addr (addr__id, person_org__id)
-VALUES (102, 212);
-
--- Update person_org__addr.
-UPDATE person_org__addr
-SET addr__id = 102,
-WHERE person_org__id = 212;
-
View
28 sql/Pg/Bric/Biz/Org/Person.use
@@ -1,28 +0,0 @@
--- Project: Bricolage Business API
--- File: Person.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT o.id, o.name, o.long_name, o.active, po.id, po.person__id, po.type,
- po.department, po.title, po.active
-FROM org o, person_org po
-WHERE o.id = po.org__id
- AND po.id = 212;
-
-INSERT INTO person_org (id, person__id, org__id, type, department, title,
- active)
-VALUES (seq_person_org.NextVal, 34, 56, 'Employer', 'Engineering',
- 'Software Engineer', 1);
-
-UPDATE person_org
-SET id = 212,
- person__id = 34,
- org__id = 56,
- type = 'Employer',
- department = 'Engineering',
- title = 'Software Engineer'
- active = 1
-WHERE id = 212;
-
View
39 sql/Pg/Bric/Biz/Org/Source.use
@@ -1,39 +0,0 @@
--- Project: Bricolage Business API
--- File: Source.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
---
--- INSERT statements.
---
-
-INSERT INTO source (id, org__id, name, description, expire, active)
-VALUES (1, 9, 'AP 30', 'Associated Press 30 Day', 30, 1);
-
---
--- UPDATE statements.
---
-
-UPDATE source
-SET id = 1,
- org__id = 9,
- name = 'AP 30',
- description = 'Associated Press 30 Day',
- expire = 1,
- active = 1
-WHERE id = 1;
-
---
--- SELECT statements.
---
-
-SELECT s.id, o.id, o.name, o.long_name, s.name, s.description, s.expire,
- s.active, o.active
-FROM source s, org o
-WHERE o.id = s.org__id
- AND s.id = 1;
-
-
-
View
34 sql/Pg/Bric/Biz/Person.use
@@ -1,34 +0,0 @@
--- Project: Bricolage Business API
--- File: Person.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-
-SELECT id, prefix, lname, fname, mname, suffix, active
-FROM person
-WHERE id = 34;
-
-SELECT id, prefix, lname, fname, mname, suffix, active
-FROM person
-WHERE lower(lname) like 'whee%';
-
-SELECT id, prefix, lname, fname, mname, suffix, active
-FROM person
-WHERE lower(lname) LIKE 'wheeler%'
- AND lower(fname) LIKE 'david%';
-
-INSERT INTO person (id, prefix, lname, fname, mname, suffix, active)
-VALUES (seq_person.NextVal, 'Mr.', 'Wheeler', 'David', 'Erin', 'MA', 1);
-
-UPDATE person
-SET id = 34,
- prefix = 'Mr.',
- lname = 'Wheeler',
- fname = 'David',
- mname = 'Erin',
- suffix = 'MA',
- active = 1
-WHERE id = 34;
-
View
23 sql/Pg/Bric/Biz/Person/User.use
@@ -1,23 +0,0 @@
--- Project: Bricolage Business API
--- File: User.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT u.id, p.prefix, p.lname, p.fname, p.mname, p.suffix, p.active, u.login,
- u.password, u.active
-FROM person p, user u
-WHERE p.id = u.id
- AND u.id = 22;
-
-INSERT INTO user (id, login, password, active)
-VALUES (34, 'Theory', '*49f9,fiFIGi383$*,;', 1);
-
-UPDATE user
-SET id = 22,
- login = 'Theory',
- password = '*49f9,fiFIGi383$*,;',
- active = 1
-WHERE id = 22;
-
View
97 sql/Pg/Bric/Biz/Workflow.use
@@ -1,97 +0,0 @@
--- -----------------------------------------------------------------------------
--- Workflow.use
---
--- VERSION: $LastChangedRevision$
---
--- SQL usage for the workflow class
-
--- -----------------------------------------------------------------------------
--- Actions
--- -----------------------------------------------------------------------------
-
--- SELECT
--- * Select a specific workflow.
--- * Select all workflows of a particular type.
---
--- UPDATE
--- * Change the description of a workflow
--- * Change the name of a workflow type.
---
--- INSERT
--- * Add a new workflow type
--- * Add a new workflow
-
-
--- -----------------------------------------------------------------------------
--- Section: SELECT
--- -----------------------------------------------------------------------------
-
--- What: Select a specific workflow.
--- Given: Workflow ID - $w_id
-
-SELECT
- w.id, w.description, wt.name, w.active
-FROM
- workflow w, workflow_type wt
-WHERE
- w.id = $w_id AND
- w.workflow_type__id = wt.id
-
--- What: Select all workflows of a particular type.
--- Given: Worflow type - $name
-
-SELECT
- w.id, w.description, wt.name
-FROM
- workflow w, workflow_type wt
-WHERE
- wt.name = $name AND
- w.workflow_type__id = wt.id AND
- w.active = 1
-
--- -----------------------------------------------------------------------------
--- Section: UPDATE
--- -----------------------------------------------------------------------------
-
--- What: Change the description of a workflow
--- Given: Workflow ID - $w_id, Description - $desc
-
-UPDATE
- workflow
-SET
- (description = $desc)
-WHERE
- id = $w_id
-
--- What: Change the name of a workflow type.
--- Given: Workflow type ID - $wt_id, Workflow type name - $name
-
-UPDATE
- workflow_type
-SET
- (name = $name)
-WHERE
- id = $wt_id
-
-
--- -----------------------------------------------------------------------------
--- Section: INSERT
--- -----------------------------------------------------------------------------
-
--- What: Add a new workflow type
--- Given: Workflow type name - $name
-
-INSERT INTO
- workflow_type
- (id, name)
-VALUES
- (seq_workflow_type.nextval, $name)
-
--- What: Add a new workflow
--- Given: Worflow description - $desc, Worflow type ID - $wt_id
-
-INSERT INTO
- workflow_type
- (id, description, workflow_type__id)
-VALUES
- (seq_workflow.nextval, $desc, $wt_id)
View
131 sql/Pg/Bric/Biz/Workflow/Parts/Desk.use
@@ -1,131 +0,0 @@
--- -----------------------------------------------------------------------------
--- Desk.use
---
--- VERSION: $LastChangedRevision$
---
--- Sample SQL usage for the Desk tables
-
--- -----------------------------------------------------------------------------
--- Actions
--- -----------------------------------------------------------------------------
-
--- SELECT
--- * Get the description for a desk.
--- * Get all the rules for a desk.
--- * Get all the rules for a particular role
--- * Find all the possible desks available to go to from another desk.
---
--- UPDATE
--- * Change the description for a desk.
---
--- INSERT
--- * Add a new desk.
--- * Add a new rule role
--- * Add a new rule for a desk.
--- * Add a new desk ordering
-
-
--- -----------------------------------------------------------------------------
--- Section: SELECT
--- -----------------------------------------------------------------------------
-
--- What: Get the description for a desk.
--- Given: Desk ID - $d_id
-
-SELECT
- id
-FROM
- desk
-WHERE
- id = $d_id
-
--- What: Get all the rules for a desk.
--- Given: Desk ID - $d_id
-
-SELECT
- desk_rule__id, role__id
-FROM
- desk_rule_set
-WHERE
- desk__id = $d_id AND
- active = 1
-
--- What: Get all the rules for a particular role
--- Given: Role name - $name
-
-SELECT
- desk_rule__id
-FROM
- desk_rule_set rs, desk_rule_role rr
-WHERE
- rr.name = $name AND
- rr.id = rs.role__id AND
- rs.active = 1
-
--- What: Find all the possible desks available to go to from another desk.
--- Given: Source desk ID - $sd_id
-
-SELECT
- link_desk__id
-FROM
- desk_order
-WHERE
- desk__id = $sd_id AND
- desk_link_type = 'TO' AND
- active = 1
-
--- -----------------------------------------------------------------------------
--- Section: UPDATE
--- -----------------------------------------------------------------------------
-
--- What: Change the description for a desk.
--- Given: A desk ID - $d_id, A description - $desc
-
-UPDATE
- desk
-SET
- (description = $desc)
-WHERE
- id = $d_id
-
-
--- -----------------------------------------------------------------------------
--- Section: INSERT
--- -----------------------------------------------------------------------------
-
--- What: Add a new desk.
--- Given: A desk description - $desc
-
-INSERT INTO
- desk
- (id, description)
-VALUES
- (seq_desk.nextval, $desc)
-
--- What: Add a new rule role
--- Given: Role name - $name, Role description - $desc
-
-INSERT INTO
- desk_rule_role
- (id, name, description)
-VALUES
- (seq_desk_rule_role.nextval, $name, $desc)
-
--- What: Add a new rule for a desk.
--- Given: Rule ID - $r_id, Desk ID - $d_id, Role ID - $role_id
-
-INSERT INTO
- desk_rule_set
- (id, desk__id, desk_rule__id, role__id)
-VALUES
- (seq_desk_rule_set.nextval, $d_id, $r_id, $role_id)
-
--- What: Add a new desk ordering
--- Given: Workflow ID - $w_id, Desk ID - $d_id, Linked desk ID - $ld_id
--- Link type - $type
-
-INSERT INTO
- desk_order
- (id, workflow__id, desk__id, link_desk__id, desk_link_type)
-VALUES
- (seq_desk_order.nextval, $w_id, $d_id, $ld_id, $type)
View
39 sql/Pg/Bric/Dist/Action.use
@@ -1,39 +0,0 @@
--- Project: Bricolage Business API
--- File: Action.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
---
--- INSERT statements.
---
-
-INSERT INTO action (id, ord, server_type__id, action_type__id)
-VALUES (1, 1, 1, 1);
-
---
--- UPDATE statements.
---
-
-UPDATE action
-SET id = 1,
- ord = 1,
- server_type__id = 1,
- action_type__id = 1,
-WHERE id = 1;
-
---
--- SELECT statements.
---
-
-SELECT a.id, a.ord, a.server_type__id, t.id, t.name, t.description, m.name
-FROM action a, action_type t, action_type__media_type am, media_type m
-WHERE a.action_type__id = t.id
- AND t.id = am.action_type__id
- AND am.media_type__id = m.id
- AND a.id = 1
-ORDER BY a.server_type__id, a.ord;
-
-
-
View
16 sql/Pg/Bric/Dist/ActionType.use
@@ -1,16 +0,0 @@
--- Project: Bricolage Business API
--- File: ActionType.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
--- SELECT statement.
-SELECT a.id, a.name, a.description, a.active, t.name, c.pkg_name
-FROM action_type a, action_type__media_type m, media_type t
-WHERE a.id = m.action_type__id
- AND m.media_type__id = t.id
- AND a.name = 'Ultraseek';
-
-
-
View
97 sql/Pg/Bric/Dist/Resource.use
@@ -1,97 +0,0 @@
--- Project: Bricolage Business API
--- File: Resource.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
---
--- INSERT statements.
---
-
-INSERT INTO resource (id, media_type__id, path, size, mod_time, is_dir)
-VALUES (1, 311, '/data/content/tech/feature', 0, '2001-02-14 10:45:34', 1);
-
-INSERT INTO resource (id, media_type__id, path, size, mod_time, is_dir)
-VALUES (2, 313, '/data/content/tech/feature/index.html', 324, '2001-02-14 10:45:34', 0);
-
-/*
-
-INSERT INTO story__resource (story__id, resource__id)
-VALUES (1, 1);
-
-INSERT INTO media__resource (media__id, resource__id)
-VALUES (2, 1);
-
-*/
-
-INSERT INTO resource__resource (dir_id, file_id)
-VALUES (1, 2);
-
---
--- UPDATE statements.
---
-
-UPDATE resource
-SET id = 2,
- media_type__id = 313,
- path = '/data/content/tech/feature/foo.html',
- size = 4562,
- mod_time = '2001-02-14 11:32:54',
- is_dir = 0
-WHERE id = 2;
-
---
--- SELECT statements.
---
-
--- Ideally, we'd use this outer join. We should be able to do so beginning with
--- PostgreSQL version 7.1. See
--- http://www.postgresql.org/docs/faq-english.html#4.24.
-SELECT r.id, t.name, r.path, r.size, r.mod_time, r.is_dir, s.story__id,
- m.media__id
-FROM resource r, media_type t, story__resource s, media__resource m
-FROM resource r, media_type t,
- LEFT OUTER JOIN story__resource s USING (r.id = s.resource__id),
- LEFT OUTER JOIN media__resource m USING (r.id = m.resource__id)
-WHERE r.id = 2
- AND r.media_type__id = t.id;
-
--- Meanwhile, we need to use separate joins.
-SELECT r.id, r.parent_id, t.name, r.path, r.size, r.mod_time, r.is_dir
-FROM resource r, media_type t
-WHERE r.id = 2
- AND r.media_type__id = t.id;
-
-SELECT story__id
-FROM story__resource
-WHERE resource__id = 2;
-
-SELECT media__id
-FROM media__resource
-WHERE resource__id = 2;
-
---
--- DELETE statements.
---
-
-DELETE FROM story__resource
-WHERE story__id = 1
- AND resource__id = 2;
-
-DELETE FROM media__resource
-WHERE media__id = 2
- AND resource__id = 1;
-
-DELETE FROM resource__resource
-WHERE dir_id = 1
- AND file_id = 2;
-
-DELETE FROM resource
-WHERE id = 2;
-
-DELETE FROM resource
-WHERE id = 1;
-
-
-
View
35 sql/Pg/Bric/Dist/ServerType.use
@@ -1,35 +0,0 @@
--- Project: Bricolage Business API
--- File: ServerType.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
--- INSERT statement.
-
-INSERT INTO server_type (id, class__id, name, description, copyable, active)
-VALUES (1, (SELECT id FROM class WHERE pkg_name = 'Bric::Dist::Action::Mover::FTP' AND distributor = 1),
- 'Preview Server', 'Servers of this type handle previews.', 0, 1);
-
--- UPDATE statement.
-
-UPDATE server_type
-SET id = 1,
- class__id = (SELECT id
- FROM class
- WHERE pkg_name = 'Bric::Dist::Action::Mover::FTP'
- AND distributor = 1),
- name = 'Preview Server',
- description = 'Servers of this type handle previews.',
- copyable = 0,
- active = 1
-WHERE id = 1;
-
-
--- SELECT statement.
-SELECT s.id, c.pkg_name, s.name, s.description, s.copyable, s.active
-FROM server_type s, class c
-WHERE s.class__id = c.id
- AND s.id = 1;
-
-
View
15 sql/Pg/Bric/Util/Alert.use
@@ -1,15 +0,0 @@
--- Project: Bricolage Business API
--- File: Alert.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT id, event__id, alert_type__id, subject, message, timestamp
-FROM alert
-WHERE id = 1;
-
-INSERT INTO alert (id, event__id, alert_type__id, subject, message, timestamp)
-VALUES (seq_alert.NextVal, 1, 2,
- 'Password Changed', 'Password changed for User Theory (David Wheeler).',
- SYSDATE);
View
23 sql/Pg/Bric/Util/AlertType.use
@@ -1,23 +0,0 @@
--- Project: Bricolage Business API
--- File: AlertType.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT id, event_type__id, usr__id, name, subject, message, active
-FROM alert_type
-WHERE id = 1;
-
-INSERT INTO alert_type (id, event_type__id, usr__id, name, subject, message)
-VALUES (seq_alert_type.NextVal, 1, 2, 'Story Publish', '$url Published',
- 'The story with the URL ''$url'' has been published.');
-
-UPDATE alert_type
-SET id = 1,
- event_type__id = 2,
- usr__id = 1,
- name = 'Story Publish',
- subject = '$url Published',
- message = 'The story with the URL ''$url'' has been published.'
-WHERE id = 1;
View
24 sql/Pg/Bric/Util/AlertType/Parts/Rule.use
@@ -1,24 +0,0 @@
--- Project: Bricolage Business API
--- File: Rule.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT id, alert_type__id, attr, operator, value
-FROM alert_type_rule
-WHERE id = 1;
-
-INSERT INTO alert_type_rule (id, alert_type__id, attr, operator, value)
-VALUES (seq_alert_type_rule.NextVal, 2, 'hair color', 'eq', 'blonde');
-
-UPDATE alert_type_rule
-SET id = 1,
- alert_type__id = 2,
- attr = 'hair color',
- operator = 'eq',
- value = 'blonde'
-WHERE id = 1;
-
-DELETE FROM alert_type_rule
-WHERE id = 1;
View
23 sql/Pg/Bric/Util/Alerted.use
@@ -1,23 +0,0 @@
--- Project: Bricolage Business API
--- File: Alerted.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-INSERT INTO alerted (id, usr__id, alert__id)
-VALUES (1, 2, 1);
-
-INSERT INTO alerted__contact_value
- (alerted__id, contact_value__id, contact_value__value, sent_time)
-VALUES (1, 1, 'david@justatheory.com', SYSDATE);
-
-UPDATE alerted
-SET ack_time = SYSDATE
-WHERE id = 1;
-
-SELECT a.id, a.usr__id, a.alert__id, a.ack_time, c.contact_value__id,
- c.contact_value__value, c.sent_time
-FROM alerted a, alerted__contact_value c
-WHERE a.id = c.alerted__id
- AND a.id = 1;
View
227 sql/Pg/Bric/Util/Attribute.use
@@ -1,227 +0,0 @@
--- -----------------------------------------------------------------------------
--- Attribute.use
---
--- VERSION: $LastChangedRevision$
---
--- This file contains the recomended SQL for accessing the tables defined in
--- Attribute.sql. That is this is the SQL required to access the attribute
--- system.
---
--- Notes
---
--- Any insert using a name and subsystem should fail if it sets more than one
--- row. If one wants to set a multivalue attribute the attribute value ID must
--- be used to set the attribute.
---
--- The data type will be used for inserts to make sure the right table is used
--- for inserting new data.
-
-
--- -----------------------------------------------------------------------------
--- Actions
--- -----------------------------------------------------------------------------
-
--- SELECT
--- * Select a single attribute value for an asset object
--- * Select all name/value pairs of an asset object for a given subsystem
--- * Select all subsystem names of an asset object
--- * Select one metadata point for a particular asset attribute
--- * Select all metadata points for a particular asset attribute
--- * Select a single attribute ID for an asset object
--- * Select an attribute type ID for an asset object.
--- * All data for a single attribute
---
--- UPDATE
--- * Set a single asset attribute value
--- * Set a single asset attribute metadata value
---
--- INSERT
--- * Add a new class type
--- * Add a new subsystem
--- * Add a new asset attribute type
--- * Add a new asset attribute value
--- * Add a new asset attribute metadata value
-
--- -----------------------------------------------------------------------------
--- Section: SELECT
--- -----------------------------------------------------------------------------
-
--- What: Select a single attribute value for a person object
--- Given: Person ID - $p_id, Subsys - $subsys, Name - $name
--- Note: If the data type is known then there is no need for the OR blocks.
-
-SELECT
- dv.value, sv.value, bv.value
-FROM
- attr_person_date_val dv, attr_person_short_val sv,
- attr_person_blob_val bv, attr_person ap
-WHERE
- ap.subsys = $subsys AND
- ap.name = $name AND
- ((dv.attr_person__id = ap.id AND dv.person__id = $p_id) OR
- (sv.attr_person__id = ap.id AND sv.person__id = $p_id) OR
- (bv.attr_person__id = ap.id AND bv.person__id = $p_id))
-
--- What: Select all name/value pairs of an person object for a given subsystem
--- Given: Person ID - $a_id, Subsys - $subsys
--- Note: If the data type is known then there is no need for the OR blocks.
-
-SELECT
- ap.name, dv.value, sv.value, bv.value
-FROM
- attr_person_date_val dv, attr_person_short_val sv,
- attr_person_blob_val bv, attr_person ap
-WHERE
- ap.subsys = $subsys AND
- ((dv.attr_person__id = ap.id AND dv.person__id = $p_id) OR
- (sv.attr_person__id = ap.id AND sv.person__id = $p_id) OR
- (bv.attr_person__id = ap.id AND bv.person__id = $p_id))
-
-
--- What: Select all subsystem names of an asset object
--- Given: None
-
-SELECT
- subsys
-FROM
- attr_person
-
-
--- What: Select one metadata point for a particular asset attribute
--- Given: Subsystem - $subsys, Attribute name - $name, Metadata - $meta_name
-
-SELECT
- apm.meta_value
-FROM
- attr_person ap, attr_person_meta apm
-WHERE
- ap.subsys = $subsys AND
- ap.name = $name AND
- ap.id = apm.attr_person__id AND
- apm.meta_name = $meta_name
-
-
--- What: Select all metadata points for a particular asset attribute
--- Given: Subsystem - $subsys, Attribute name - $name
-
-SELECT
- apm.meta_name, apm.meta_value
-FROM
- attr_person ap, attr_person_meta apm
-WHERE
- ap.subsys = $subsys AND
- ap.name = $name AND
- ap.id = apm.attr_person__id
-
-
--- What: Select a single attribute ID for an asset object
--- Given: Person ID - $p_id, Subsys - $subsys, Name - $name
--- Note: If the data type is known then there is no need for the OR blocks.
-
-SELECT
- dv.id, sv.id, bv.id
-FROM
- attr_person_date_val dv, attr_person_short_val sv,
- attr_person_blob_val bv, attr_person ap
-WHERE
- ap.subsys = $subsys AND
- ap.name = $name AND
- ((dv.attr_person__id = ap.id AND dv.person__id = $p_id) OR
- (sv.attr_person__id = ap.id AND sv.person__id = $p_id) OR
- (bv.attr_person__id = ap.id AND bv.person__id = $p_id))
-
-
--- What: Select an attribute type ID for an asset object.
--- Given: Subsys - $subsys, Name - $name
-
-SELECT
- id
-FROM
- attr_person
-WHERE
- subsys = $subsys AND
- name = $name
-
-
--- What: All data for a single attribute
--- Given: Person ID - $p_id, Subsys - $subsys, Name - $name, Data type - short
-
-SELECT
- sv.value, apm.name, apm.value
-FROM
- attr_person_short_val sv, attr_person ap, attr_person_meta apm
-WHERE
- ap.subsys = $subsys AND
- ap.name = $name AND
- sv.attr_person__id = ap.id AND
- sv.person__id = $p_id AND
- ap.id = apm.attr_person__id
-
--- -----------------------------------------------------------------------------
--- UPDATE
--- -----------------------------------------------------------------------------
-
--- What: Set a single asset attribute value
--- Given: Person ID - $p_id, Subsystem - $subsys, Attribute name - $name,
--- Attribute value - $value
--- Notes: This assumes that the type of value being set is a short value.
-
-UPDATE
- attr_short_val
-SET
- value = $value
-WHERE
- attr_person.subsys = $subsys AND
- attr_person.name = $name AND
- attr_person__id = attr_person.id AND
- person__id = $p_id
-
-
--- What: Set a single metadata value
--- Given: Subsystem - $subsys, Attribute name - $name,
--- Metadata Name - $meta_name
-
-UPDATE
- attr_person_meta
-SET
- meta_value
-WHERE
- attr_person.subsys = $subsys AND
- attr_person.name = $name AND
- attr_person__id = attr_person.id
-
--- -----------------------------------------------------------------------------
--- INSERT
--- -----------------------------------------------------------------------------
-
--- What: Add a new attribute type
--- Given: Subsystem - $subsys, Attribute name - $name, Data type - $type
-
-INSERT INTO
- attr_person
- (id, subsys, name, sql_type, active)
-VALUES
- (seq_attr_person.nextval, $subsys, $name, $type, 1)
-
--- What: Add a new attribute value
--- Given: Person ID - $p_id, Subsystem - $subsys, Attribute name - $name,
--- Attribute value - $value, Attribute type ID - $at_id
--- Note: The attribute person ID value is needed to avoid doing a sub select
--- which may not work on different databases.
-
-INSERT INTO
- attr_person_short_val
- (id, person__id, attr_person__id, value)
-VALUES
- (seq_attr_person_val.nextval, $p_id, $at_id, $value))
-
-
--- What: Add a new asset attribute metadata value
--- Given: Attribute type ID - $at_id, Metadata name - $name,
--- Metadata value - $value
-
-INSERT INTO
- attr_person_meta
- (id, attr_person__id, meta_name, meta_value)
-VALUES
- (seq_attr_meta.nextval, $at_id, $name, $value)
View
17 sql/Pg/Bric/Util/Event.use
@@ -1,17 +0,0 @@
--- Project: Bricolage Business API
--- File: Event.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT e.id, t.id, e.usr__id, e.obj_id, e.timestamp, t.key_name,
- g.name, g.description, c.pkg_name, g.id
-FROM event e, grp g, class c, event_type t
-WHERE e.event_type__id = t.id
- AND t.class__id = c.id
- AND t.grp__id = g.id
- AND e.id = 1024;
-
-INSERT INTO event (id, event_type__id, user__id, obj_id, timestamp)
-VALUES (NextVal('seq_event'), 125, 22, 49593, sysdate);
View
28 sql/Pg/Bric/Util/EventType.use
@@ -1,28 +0,0 @@
--- Project: Bricolage Business API
--- File: EventType.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT t.id, t.grp__id, c.pkg_name, c.disp_name, t.active
-FROM event_type t, class c
-WHERE c.id = t.class__id
- AND t.id = 1025;
-
-SELECT t.id, t.grp__id, c.pkg_name, c.disp_name, t.active
-FROM event_type t, class c, grp g
-WHERE c.id = t.class__id
- AND g.id = t.grp__id
- AND g.class__id = 1051
- AND g.name like 'Story Publish';
-
-INSERT INTO event_type (id, class__id, grp__id, active)
-VALUES (seq_event_type.NextVal, 1024, 2, 1);
-
-UPDATE event_type
-SET id = 1,
- class__id = 1024,
- grp__id = 2,
- active = 1
-WHERE id = 1025;
View
12 sql/Pg/Bric/Util/MediaType.use
@@ -1,12 +0,0 @@
--- Project: Bricolage Business API
--- File: MeidiaType.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
--- No usage sample. See MediaType.pm instead.
-
-
-
-
View
23 sql/Pg/Bric/Util/Pref.use
@@ -1,23 +0,0 @@
--- Project: Bricolage Business API
--- File: Pref.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT p.id, p.name, p.description, p.value, p.def, o.value, o.description
-FROM pref p, pref_opt o
-WHERE p.id = o.pref__id
- AND p.id = 1;
-
-INSERT INTO pref (id, name, description, value, def)
-VALUES (1, 'Time Zone', 'Time Zone', 'America/Los_Angeles', 'America/Los_Angeles');
-
-INSERT INTO pref_opt (pref__id, value, description)
-VALUES (1, 'UTC', 'Coordinated Universal Time (UTC)');
-
-UPDATE pref
-SET value = 'UTC'
-WHERE id = 1;
-
-
View
28 sql/Pg/Bric/Util/Priv.use
@@ -1,28 +0,0 @@
--- Project: Bricolage Business API
--- File: Priv.use
--- VERSION: $LastChangedRevision$
---
--- $LastChangedDate$
--- Author: David Wheeler <david@justatheory.com>
-
-SELECT p.id, p.grp__id, g.grp__id, p.value
-FROM grp_priv p, grp_priv__grp_member g
-WHERE p.id = g.grp_priv__id
- AND p.id = 1;
-
-INSERT INTO grp_priv (id, grp__id, value)
-VALUES (1, 3, 3);
-
-INSERT INTO grp_priv__grp_member (grp_priv__id, grp__id)
-VALUES (1, 1);
-
-UPDATE grp_priv__grp_member
-SET grp_priv__id = 2
-WHERE grp_priv__id = 1
- and grp__id = 1;
-
-DELETE FROM grp_priv__grp_member
-WHERE grp_priv__id = 1;
-
-DELETE FROM grp_priv
-WHERE id = 1;
Please sign in to comment.
Something went wrong with that request. Please try again.