--- /dev/null
+use utf8;
+package Debbugs::DB::Result::BinAssociation;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Debbugs::DB::Result::BinAssociation
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 COMPONENTS LOADED
+
+=over 4
+
+=item * L<DBIx::Class::InflateColumn::DateTime>
+
+=back
+
+=cut
+
+__PACKAGE__->load_components("InflateColumn::DateTime");
+
+=head1 TABLE: C<bin_associations>
+
+=cut
+
+__PACKAGE__->table("bin_associations");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+ sequence: 'bin_associations_id_seq'
+
+=head2 suite
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 bin
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 created
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=head2 modified
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "bin_associations_id_seq",
+ },
+ "suite",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "bin",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "created",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+ "modified",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
+
+=head2 bin
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::BinVer>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "bin",
+ "Debbugs::DB::Result::BinVer",
+ { id => "bin" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 suite
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::Suite>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "suite",
+ "Debbugs::DB::Result::Suite",
+ { id => "suite" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/cCrHn40eoiD6aOPmXU8dw
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
=head1 ACCESSORS
+=head2 id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+ sequence: 'bin_ver_id_seq'
+
=head2 bin_pkg_id
data_type: 'integer'
=head2 ver
- data_type: 'text'
+ data_type: 'debversion'
is_nullable: 0
=cut
__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "bin_ver_id_seq",
+ },
"bin_pkg_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"src_ver_id",
"arch_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"ver",
- { data_type => "text", is_nullable => 0 },
+ { data_type => "debversion", is_nullable => 0 },
);
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
=head1 UNIQUE CONSTRAINTS
=head2 C<bin_ver_bin_pkg_id_arch_idx>
=item * L</arch_id>
+=item * L</ver>
+
=back
=cut
-__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg_id", "arch_id"]);
+__PACKAGE__->add_unique_constraint(
+ "bin_ver_bin_pkg_id_arch_idx",
+ ["bin_pkg_id", "arch_id", "ver"],
+);
=head2 C<bin_ver_src_ver_id_arch_idx>
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
+=head2 bin_associations
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::BinAssociation>
+
+=cut
+
+__PACKAGE__->has_many(
+ "bin_associations",
+ "Debbugs::DB::Result::BinAssociation",
+ { "foreign.bin" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
=head2 bin_pkg
Type: belongs_to
);
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-07-17 10:25:29
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0AnavpmoUrdrgChtyIBRBg
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ID7wx8HJaYZgpdhHqCq8GQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
--- /dev/null
+use utf8;
+package Debbugs::DB::Result::BinaryVersion;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Debbugs::DB::Result::BinaryVersion
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 COMPONENTS LOADED
+
+=over 4
+
+=item * L<DBIx::Class::InflateColumn::DateTime>
+
+=back
+
+=cut
+
+__PACKAGE__->load_components("InflateColumn::DateTime");
+
+=head1 TABLE: C<binary_versions>
+
+=cut
+
+__PACKAGE__->table("binary_versions");
+
+=head1 ACCESSORS
+
+=head2 src_pkg
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 src_ver
+
+ data_type: 'debversion'
+ is_nullable: 1
+
+=head2 bin_pkg
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 arch
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 bin_ver
+
+ data_type: 'debversion'
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "src_pkg",
+ { data_type => "text", is_nullable => 1 },
+ "src_ver",
+ { data_type => "debversion", is_nullable => 1 },
+ "bin_pkg",
+ { data_type => "text", is_nullable => 1 },
+ "arch",
+ { data_type => "text", is_nullable => 1 },
+ "bin_ver",
+ { data_type => "debversion", is_nullable => 1 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-23 23:44:18
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:04R2st85wn634BqbBU2/qQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
--- /dev/null
+use utf8;
+package Debbugs::DB::Result::Maintainer;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Debbugs::DB::Result::Maintainer
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 COMPONENTS LOADED
+
+=over 4
+
+=item * L<DBIx::Class::InflateColumn::DateTime>
+
+=back
+
+=cut
+
+__PACKAGE__->load_components("InflateColumn::DateTime");
+
+=head1 TABLE: C<maintainer>
+
+=cut
+
+__PACKAGE__->table("maintainer");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+ sequence: 'maintainer_id_seq'
+
+=head2 name
+
+ data_type: 'text'
+ is_nullable: 0
+
+=head2 created
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=head2 modified
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "maintainer_id_seq",
+ },
+ "name",
+ { data_type => "text", is_nullable => 0 },
+ "created",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+ "modified",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<maintainer_name_key>
+
+=over 4
+
+=item * L</name>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint("maintainer_name_key", ["name"]);
+
+=head1 RELATIONS
+
+=head2 src_vers
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::SrcVer>
+
+=cut
+
+__PACKAGE__->has_many(
+ "src_vers",
+ "Debbugs::DB::Result::SrcVer",
+ { "foreign.maintainer_id" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XOB1oEoov4hXMzTD4A7KHg
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
--- /dev/null
+use utf8;
+package Debbugs::DB::Result::SrcAssociation;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Debbugs::DB::Result::SrcAssociation
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 COMPONENTS LOADED
+
+=over 4
+
+=item * L<DBIx::Class::InflateColumn::DateTime>
+
+=back
+
+=cut
+
+__PACKAGE__->load_components("InflateColumn::DateTime");
+
+=head1 TABLE: C<src_associations>
+
+=cut
+
+__PACKAGE__->table("src_associations");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+ sequence: 'src_associations_id_seq'
+
+=head2 suite
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 source
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 created
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=head2 modified
+
+ data_type: 'timestamp with time zone'
+ default_value: current_timestamp
+ is_nullable: 0
+ original: {default_value => \"now()"}
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "src_associations_id_seq",
+ },
+ "suite",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "source",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "created",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+ "modified",
+ {
+ data_type => "timestamp with time zone",
+ default_value => \"current_timestamp",
+ is_nullable => 0,
+ original => { default_value => \"now()" },
+ },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
+
+=head2 source
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::SrcVer>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "source",
+ "Debbugs::DB::Result::SrcVer",
+ { id => "source" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 suite
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::Suite>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "suite",
+ "Debbugs::DB::Result::Suite",
+ { id => "suite" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wa7w7q9pWea8Td3wJ7c1FQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
=head2 ver
- data_type: 'text'
+ data_type: 'debversion'
is_nullable: 0
+=head2 maintainer_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 1
+
=head2 upload_date
data_type: 'timestamp with time zone'
"src_pkg_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"ver",
- { data_type => "text", is_nullable => 0 },
+ { data_type => "debversion", is_nullable => 0 },
+ "maintainer_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"upload_date",
{
data_type => "timestamp with time zone",
{ cascade_copy => 0, cascade_delete => 0 },
);
+=head2 maintainer
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::Maintainer>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "maintainer",
+ "Debbugs::DB::Result::Maintainer",
+ { id => "maintainer_id" },
+ {
+ is_deferrable => 1,
+ join_type => "LEFT",
+ on_delete => "CASCADE",
+ on_update => "CASCADE",
+ },
+);
+
+=head2 src_associations
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::SrcAssociation>
+
+=cut
+
+__PACKAGE__->has_many(
+ "src_associations",
+ "Debbugs::DB::Result::SrcAssociation",
+ { "foreign.source" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
=head2 src_pkg
Type: belongs_to
);
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-07-17 17:10:22
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sYRJ4htIIKwvuvbUemk90A
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1YjejvJjXTE1Q6OjD5x9zg
# You can replace this text with custom code or comments, and it will be preserved on regeneration
--- /dev/null
+use utf8;
+package Debbugs::DB::Result::Suite;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Debbugs::DB::Result::Suite
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 COMPONENTS LOADED
+
+=over 4
+
+=item * L<DBIx::Class::InflateColumn::DateTime>
+
+=back
+
+=cut
+
+__PACKAGE__->load_components("InflateColumn::DateTime");
+
+=head1 TABLE: C<suite>
+
+=cut
+
+__PACKAGE__->table("suite");
+
+=head1 ACCESSORS
+
+=head2 id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+ sequence: 'suite_id_seq'
+
+=head2 suite_name
+
+ data_type: 'text'
+ is_nullable: 0
+
+=head2 version
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 codename
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 active
+
+ data_type: 'boolean'
+ default_value: true
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "suite_id_seq",
+ },
+ "suite_name",
+ { data_type => "text", is_nullable => 0 },
+ "version",
+ { data_type => "text", is_nullable => 1 },
+ "codename",
+ { data_type => "text", is_nullable => 1 },
+ "active",
+ { data_type => "boolean", default_value => \"true", is_nullable => 1 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<suite_suite_name_key>
+
+=over 4
+
+=item * L</suite_name>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint("suite_suite_name_key", ["suite_name"]);
+
+=head1 RELATIONS
+
+=head2 bin_associations
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::BinAssociation>
+
+=cut
+
+__PACKAGE__->has_many(
+ "bin_associations",
+ "Debbugs::DB::Result::BinAssociation",
+ { "foreign.suite" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
+=head2 src_associations
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::SrcAssociation>
+
+=cut
+
+__PACKAGE__->has_many(
+ "src_associations",
+ "Debbugs::DB::Result::SrcAssociation",
+ { "foreign.suite" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XTRTAvkuZCBlDB6tSQXDDQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
DROP VIEW bug_package CASCADE;
DROP TABLE bug_srcpackage CASCADE;
DROP TABLE bug_binpackage CASCADE;
+DROP VIEW bug_package CASCADE;
+DROP VIEW binary_versions CASCADE;
+DROP TABLE suite CASCADE;
+DROP TABLE bin_associations CASCADE;
+DROP TABLE src_associations CASCADE;
+DROP TABLE maintainer CASCADE;
-- severities
CREATE TYPE bug_severity AS ENUM ('wishlist','minor','normal',
'important','serious','grave','critical');
+CREATE TABLE maintainer (
+ id SERIAL PRIMARY KEY,
+ name TEXT NOT NULL UNIQUE,
+ created TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL,
+ modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL
+);
+
-- bugs table
CREATE TABLE bug (
id INTEGER NOT NULL PRIMARY KEY,
src_pkg_id INT NOT NULL REFERENCES src_pkg
ON UPDATE CASCADE ON DELETE CASCADE,
ver public.debversion NOT NULL,
+ maintainer_id INT REFERENCES maintainer
+ ON UPDATE CASCADE ON DELETE SET NULL,
upload_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
based_on INT REFERENCES src_ver
ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE bin_ver(
+ id SERIAL PRIMARY KEY,
bin_pkg_id INT NOT NULL REFERENCES bin_pkg
ON UPDATE CASCADE ON DELETE CASCADE,
src_ver_id INT NOT NULL REFERENCES src_ver
ON UPDATE CASCADE ON DELETE CASCADE,
arch_id INT NOT NULL REFERENCES arch
ON UPDATE CASCADE ON DELETE CASCADE,
- ver TEXT NOT NULL
+ ver public.debversion NOT NULL
);
CREATE INDEX bin_ver_ver_idx ON bin_ver(ver);
-CREATE UNIQUE INDEX bin_ver_bin_pkg_id_arch_idx ON bin_ver(bin_pkg_id,arch_id);
+CREATE UNIQUE INDEX bin_ver_bin_pkg_id_arch_idx ON bin_ver(bin_pkg_id,arch_id,ver);
CREATE UNIQUE INDEX bin_ver_src_ver_id_arch_idx ON bin_ver(src_ver_id,arch_id);
CREATE INDEX bin_ver_bin_pkg_id_idx ON bin_ver(bin_pkg_id);
CREATE INDEX bin_ver_src_ver_id_idx ON bin_ver(src_ver_id);
CREATE VIEW bug_package (bug_id,pkg_id,pkg_type,package) AS
SELECT b.bug_id,b.bin_pkg_id,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg_id UNION
- SELECT s.bug_id,s.src_pkg_id,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg_id;
\ No newline at end of file
+ SELECT s.bug_id,s.src_pkg_id,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg_id;
+
+CREATE VIEW binary_versions (src_pkg, src_ver, bin_pkg, arch, bin_ver) AS
+ SELECT sp.pkg AS src_pkg, sv.ver AS src_ver, bp.pkg AS bin_pkg, a.arch AS arch, b.ver AS bin_ver
+ FROM bin_ver b JOIN arch a ON b.arch_id = a.id
+ JOIN bin_pkg bp ON b.bin_pkg_id = bp.id
+ JOIN src_ver sv ON b.src_ver_id = sv.id
+ JOIN src_pkg sp ON sv.src_pkg_id = sp.id;
+
+CREATE TABLE suite (
+ id SERIAL PRIMARY KEY,
+ suite_name TEXT NOT NULL UNIQUE,
+ version TEXT,
+ codename TEXT,
+ active BOOLEAN DEFAULT TRUE);
+CREATE INDEX ON suite(codename);
+CREATE INDEX ON suite(version);
+
+CREATE TABLE bin_associations (
+ id SERIAL PRIMARY KEY,
+ suite INT NOT NULL REFERENCES suite ON DELETE CASCADE ON UPDATE CASCADE,
+ bin INT NOT NULL REFERENCES bin_ver ON DELETE CASCADE ON UPDATE CASCADE,
+ created TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL,
+ modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL
+);
+
+CREATE TABLE src_associations (
+ id SERIAL PRIMARY KEY,
+ suite INT NOT NULL REFERENCES suite ON DELETE CASCADE ON UPDATE CASCADE,
+ source INT NOT NULL REFERENCES src_ver ON DELETE CASCADE ON UPDATE CASCADE,
+ created TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL,
+ modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL
+);
+