-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the packageId primary key and tmp-postgres
- Loading branch information
Showing
30 changed files
with
212 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
-- A package is comprised of metadata and has many releases. | ||
create table if not exists packages ( | ||
package_id uuid primary key, | ||
namespace text not null, | ||
name text not null, | ||
synopsis text not null, | ||
owner_id uuid references users, | ||
metadata jsonb not null, -- { homepage, documentation url, repository url, issues url } | ||
created_at timestamptz not null, | ||
updated_at timestamptz not null | ||
updated_at timestamptz not null, | ||
primary key(namespace, name) | ||
); | ||
|
||
create unique index on packages(lower(name), lower(namespace)); | ||
create unique index on packages(package_id, lower(name), lower(namespace)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
create table if not exists package_publishers ( | ||
package_publisher_id uuid primary key, | ||
package_id uuid references packages not null, | ||
user_id uuid references users not null | ||
package_name text not null, | ||
package_namespace text not null, | ||
user_id uuid references users not null, | ||
|
||
constraint fk_package_publishers | ||
foreign key (package_name, package_namespace) | ||
references packages(name, namespace) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
-- A release belongs to a package, and contains multiple components. | ||
create table if not exists releases ( | ||
release_id uuid primary key, | ||
package_id uuid references packages, | ||
package_name text not null, | ||
package_namespace text not null, | ||
version text not null, | ||
archive_checksum text not null, | ||
created_at timestamptz, | ||
updated_at timestamptz | ||
created_at timestamptz not null, | ||
updated_at timestamptz not null, | ||
|
||
constraint fk_package | ||
foreign key (package_name, package_namespace) | ||
references packages(name, namespace) | ||
); | ||
|
||
create index on releases(package_id); | ||
create unique index on releases(package_id, version); | ||
create unique index on releases(package_name, package_namespace, version); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
create table if not exists requirements ( | ||
requirement_id uuid primary key, | ||
package_component_id uuid references package_components not null, -- Points to the dependent | ||
package_id uuid references packages not null, -- Points to the dependency | ||
package_name text not null, | ||
package_namespace text not null, | ||
requirement text not null, | ||
metadata jsonb not null | ||
metadata jsonb not null, | ||
|
||
constraint fk_requirements | ||
foreign key (package_name, package_namespace) | ||
references packages(name, namespace) | ||
); | ||
|
||
create index on "requirements" (package_component_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
create table if not exists package_categories ( | ||
package_category_id uuid primary key, | ||
package_id uuid references packages, | ||
category_id uuid references categories | ||
package_name text not null, | ||
package_namespace text not null, | ||
category_id uuid references categories, | ||
|
||
constraint fk_package_categories | ||
foreign key (package_name, package_namespace) | ||
references packages(name, namespace) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.