Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #856 from joyent/ether/v2-drop-uuid-ossp
Browse files Browse the repository at this point in the history
drop all uses of the unnecessary uuid-ossp extension
  • Loading branch information
karenetheridge authored Aug 8, 2019
2 parents 6e641e6 + 5c9ebcf commit 3d7b91e
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/modules/Conch::DB::Result::Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Conch::DB::Result::Validation

```
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Conch::DB::Result::ValidationPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Conch::DB::Result::ValidationPlan

```
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Conch::DB::Result::ValidationResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Conch::DB::Result::ValidationResult

```
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Conch::DB::Result::ValidationState.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Conch::DB::Result::ValidationState

```
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Conch::DB::Result::Workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Conch::DB::Result::Workspace

```
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
```
Expand Down
8 changes: 4 additions & 4 deletions lib/Conch/DB/Result/Validation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __PACKAGE__->table("validation");
=head2 id
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
Expand Down Expand Up @@ -80,7 +80,7 @@ __PACKAGE__->add_columns(
"id",
{
data_type => "uuid",
default_value => \"uuid_generate_v4()",
default_value => \"gen_random_uuid()",
is_nullable => 0,
size => 16,
},
Expand Down Expand Up @@ -185,8 +185,8 @@ __PACKAGE__->many_to_many(
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2018-09-17 14:52:33
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xi5ASzt2zuwUhj0wjj3a8A
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-08 10:16:28
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hF2BcNoTdZFdz+f7ZlRyRg

__PACKAGE__->add_columns(
'+module' => { is_serializable => 0 },
Expand Down
8 changes: 4 additions & 4 deletions lib/Conch/DB/Result/ValidationPlan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __PACKAGE__->table("validation_plan");
=head2 id
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
Expand Down Expand Up @@ -63,7 +63,7 @@ __PACKAGE__->add_columns(
"id",
{
data_type => "uuid",
default_value => \"uuid_generate_v4()",
default_value => \"gen_random_uuid()",
is_nullable => 0,
size => 16,
},
Expand Down Expand Up @@ -137,8 +137,8 @@ Composing rels: L</validation_plan_members> -> validation
__PACKAGE__->many_to_many("validations", "validation_plan_members", "validation");


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2018-09-17 14:52:33
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DJEB3Pqtab0ycOFOSnyg5A
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-08 10:16:28
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:J9AoRAdJ77oTMNAjvsHPBw

__PACKAGE__->add_columns(
'+deactivated' => { is_serializable => 0 },
Expand Down
8 changes: 4 additions & 4 deletions lib/Conch/DB/Result/ValidationResult.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __PACKAGE__->table("validation_result");
=head2 id
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
Expand Down Expand Up @@ -94,7 +94,7 @@ __PACKAGE__->add_columns(
"id",
{
data_type => "uuid",
default_value => \"uuid_generate_v4()",
default_value => \"gen_random_uuid()",
is_nullable => 0,
size => 16,
},
Expand Down Expand Up @@ -219,8 +219,8 @@ __PACKAGE__->many_to_many(
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-07 15:18:08
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9zu/UPpSUraFP17fgq2x8A
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-08 10:23:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MDpJfBbPHRVMyTrdrg2CRw

__PACKAGE__->add_columns(
'+created' => { is_serializable => 0 },
Expand Down
8 changes: 4 additions & 4 deletions lib/Conch/DB/Result/ValidationState.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __PACKAGE__->table("validation_state");
=head2 id
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
Expand Down Expand Up @@ -79,7 +79,7 @@ __PACKAGE__->add_columns(
"id",
{
data_type => "uuid",
default_value => \"uuid_generate_v4()",
default_value => \"gen_random_uuid()",
is_nullable => 0,
size => 16,
},
Expand Down Expand Up @@ -198,8 +198,8 @@ __PACKAGE__->many_to_many(
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-02-12 15:14:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:62AGs6yNbvUQTQWAr0xhCA
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-08 10:16:28
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tlHn7VElCr/Bj2mZQMdeHA

__PACKAGE__->add_columns(
'+created' => { retrieve_on_insert => 1 },
Expand Down
8 changes: 4 additions & 4 deletions lib/Conch/DB/Result/Workspace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __PACKAGE__->table("workspace");
=head2 id
data_type: 'uuid'
default_value: uuid_generate_v4()
default_value: gen_random_uuid()
is_nullable: 0
size: 16
Expand All @@ -58,7 +58,7 @@ __PACKAGE__->add_columns(
"id",
{
data_type => "uuid",
default_value => \"uuid_generate_v4()",
default_value => \"gen_random_uuid()",
is_nullable => 0,
size => 16,
},
Expand Down Expand Up @@ -184,8 +184,8 @@ Composing rels: L</user_workspace_roles> -> user_account
__PACKAGE__->many_to_many("user_accounts", "user_workspace_roles", "user_account");


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-07 15:04:34
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:grjgLmZfiUYtsI/oAXzn9A
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-08-08 10:23:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7PPE0ecivO5ZkN8DKv0mXw

use experimental 'signatures';

Expand Down
11 changes: 11 additions & 0 deletions sql/migrations/0094-drop-uuid-ossp.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SELECT run_migration(94, $$

alter table validation alter column id set default gen_random_uuid();
alter table validation_plan alter column id set default gen_random_uuid();
alter table validation_result alter column id set default gen_random_uuid();
alter table validation_state alter column id set default gen_random_uuid();
alter table workspace alter column id set default gen_random_uuid();

drop extension "uuid-ossp";

$$);
24 changes: 5 additions & 19 deletions sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';


--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;


--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';


--
-- Name: device_health_enum; Type: TYPE; Schema: public; Owner: conch
--
Expand Down Expand Up @@ -632,7 +618,7 @@ ALTER TABLE public.user_workspace_role OWNER TO conch;
--

CREATE TABLE public.validation (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
name text NOT NULL,
version integer NOT NULL,
description text NOT NULL,
Expand All @@ -650,7 +636,7 @@ ALTER TABLE public.validation OWNER TO conch;
--

CREATE TABLE public.validation_plan (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
name text NOT NULL,
description text NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
Expand All @@ -677,7 +663,7 @@ ALTER TABLE public.validation_plan_member OWNER TO conch;
--

CREATE TABLE public.validation_result (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
device_id text NOT NULL,
hardware_product_id uuid NOT NULL,
validation_id uuid NOT NULL,
Expand All @@ -697,7 +683,7 @@ ALTER TABLE public.validation_result OWNER TO conch;
--

CREATE TABLE public.validation_state (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
device_id text NOT NULL,
validation_plan_id uuid NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
Expand Down Expand Up @@ -728,7 +714,7 @@ ALTER TABLE public.validation_state_member OWNER TO conch;
--

CREATE TABLE public.workspace (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
name text NOT NULL,
description text,
parent_workspace_id uuid
Expand Down

0 comments on commit 3d7b91e

Please sign in to comment.