You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/01/10 03:38:50 UTC
[38/50] incubator-trafficcontrol git commit: makes cdn name not null
makes cdn name not null
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/709f428d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/709f428d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/709f428d
Branch: refs/heads/master
Commit: 709f428d1d95864f9744f2df1b5d4a8bb1a66137
Parents: aeaac36
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Dec 9 09:09:20 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Sun Jan 8 21:05:01 2017 -0700
----------------------------------------------------------------------
.../20161208000000_alter_cdn_name_not_null.sql | 23 ++++++++++++++++++++
traffic_ops/app/lib/Schema/Result/Cdn.pm | 8 +++----
2 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/709f428d/traffic_ops/app/db/migrations/20161208000000_alter_cdn_name_not_null.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20161208000000_alter_cdn_name_not_null.sql b/traffic_ops/app/db/migrations/20161208000000_alter_cdn_name_not_null.sql
new file mode 100644
index 0000000..a11d269
--- /dev/null
+++ b/traffic_ops/app/db/migrations/20161208000000_alter_cdn_name_not_null.sql
@@ -0,0 +1,23 @@
+/*
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+ALTER TABLE CDN ALTER COLUMN NAME SET NOT NULL;
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+ALTER TABLE CDN ALTER COLUMN NAME SET NULL;
+
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/709f428d/traffic_ops/app/lib/Schema/Result/Cdn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Schema/Result/Cdn.pm b/traffic_ops/app/lib/Schema/Result/Cdn.pm
index 57dfc6e..d8c05fd 100644
--- a/traffic_ops/app/lib/Schema/Result/Cdn.pm
+++ b/traffic_ops/app/lib/Schema/Result/Cdn.pm
@@ -33,7 +33,7 @@ __PACKAGE__->table("cdn");
=head2 name
data_type: 'text'
- is_nullable: 1
+ is_nullable: 0
=head2 last_updated
@@ -59,7 +59,7 @@ __PACKAGE__->add_columns(
sequence => "cdn_id_seq",
},
"name",
- { data_type => "text", is_nullable => 1 },
+ { data_type => "text", is_nullable => 0 },
"last_updated",
{
data_type => "timestamp with time zone",
@@ -85,7 +85,7 @@ __PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
-=head2 C<idx_54267_cdn_cdn_unique>
+=head2 C<idx_24701_cdn_cdn_unique>
=over 4
@@ -95,7 +95,7 @@ __PACKAGE__->set_primary_key("id");
=cut
-__PACKAGE__->add_unique_constraint("idx_54267_cdn_cdn_unique", ["name"]);
+__PACKAGE__->add_unique_constraint("idx_24701_cdn_cdn_unique", ["name"]);
=head1 RELATIONS