Repository: incubator-trafficcontrol Updated Branches: refs/heads/master 10cf361b3 -> a0b5eb036
removes references to migrations user and role as it is no longer used for database migrations Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c3dfa4b3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c3dfa4b3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c3dfa4b3 Branch: refs/heads/master Commit: c3dfa4b358b1a283a74493a128460e0c989e3fec Parents: 10cf361 Author: Jeremy Mitchell <mitchell...@gmail.com> Authored: Thu Jul 20 15:07:46 2017 -0600 Committer: Dan Kirkwood <dang...@gmail.com> Committed: Thu Jul 20 22:14:19 2017 -0600 ---------------------------------------------------------------------- traffic_ops/app/db/migration_readme.txt | 27 -------------------- traffic_ops/app/db/seeds.sql | 5 ++-- .../app/lib/Fixtures/Integration/Role.pm | 14 ---------- traffic_ops/app/lib/Fixtures/Role.pm | 11 +------- traffic_ops/app/lib/Fixtures/TmUser.pm | 25 ------------------ traffic_ops/app/t/api/1.1/roles.t | 10 +++++--- 6 files changed, 10 insertions(+), 82 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/db/migration_readme.txt ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/migration_readme.txt b/traffic_ops/app/db/migration_readme.txt deleted file mode 100644 index 7318d33..0000000 --- a/traffic_ops/app/db/migration_readme.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# -# 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. -# - -Create a goose migration: -Information on goose can be found here: https://bitbucket.org/liamstask/goose - -1. Download Goose -> go get bitbucket.org/liamstask/goose/cmd/goose -2. In the db directory create a dbconf.yml file. - -> A sample should be there - -> NOTE: dbconf.yml CANNOT contain tabs! -3. from the /opt/tm directory create your migration - $ goose -env=mysql create foober sql - goose: created /opt/tm/db/migrations/20141006092229_foober.sql -4. Add your database migration under the goose up section. Add any rollback under the goose down section. -5. run 'goose -env=mysql up' to perform the migration http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/db/seeds.sql ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/seeds.sql b/traffic_ops/app/db/seeds.sql index 9075f3b..386c295 100644 --- a/traffic_ops/app/db/seeds.sql +++ b/traffic_ops/app/db/seeds.sql @@ -63,13 +63,12 @@ insert into status (name, description) values ('PRE_PROD', 'Pre Production. Not -- roles insert into role (name, description, priv_level) values ('admin', 'super-user', 30) ON CONFLICT (name) DO NOTHING; insert into role (name, description, priv_level) values ('operations', 'Operations user', 20) ON CONFLICT (name) DO NOTHING; -insert into role (name, description, priv_level) values ('migrations', 'database migrations user - DO NOT REMOVE', 20) ON CONFLICT (name) DO NOTHING; insert into role (name, description, priv_level) values ('federation', 'Role for Secondary CZF', 15) ON CONFLICT (name) DO NOTHING; insert into role (name, description, priv_level) values ('steering', 'Role for Steering Delivery Services', 15) ON CONFLICT (name) DO NOTHING; -insert into role (name, description, priv_level) values ('read-only user', 'Read-Only user', 10) ON CONFLICT (name) DO NOTHING; +insert into role (name, description, priv_level) values ('ort', 'ORT User', 11) ON CONFLICT (name) DO NOTHING; +insert into role (name, description, priv_level) values ('read-only', 'Read-Only user', 10) ON CONFLICT (name) DO NOTHING; insert into role (name, description, priv_level) values ('portal', 'Portal User', 2) ON CONFLICT (name) DO NOTHING; insert into role (name, description, priv_level) values ('disallowed', 'Block all access', 0) ON CONFLICT (name) DO NOTHING; -insert into role (name, description, priv_level) values ('ort', 'ORT User', 11) ON CONFLICT (name) DO NOTHING; -- tenants insert into tenant (name, active, parent_id) values ('root', true, null) ON CONFLICT DO NOTHING; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/lib/Fixtures/Integration/Role.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/Fixtures/Integration/Role.pm b/traffic_ops/app/lib/Fixtures/Integration/Role.pm index 6510091..aa37297 100644 --- a/traffic_ops/app/lib/Fixtures/Integration/Role.pm +++ b/traffic_ops/app/lib/Fixtures/Integration/Role.pm @@ -26,7 +26,6 @@ extends 'DBIx::Class::EasyFixture'; use namespace::autoclean; my %definition_for = ( - ## id => 1 '0' => { new => 'Role', using => { @@ -35,7 +34,6 @@ my %definition_for = ( priv_level => '30', }, }, - ## id => 2 '1' => { new => 'Role', using => { @@ -44,16 +42,6 @@ my %definition_for = ( priv_level => '0', }, }, - ## id => 3 - '2' => { - new => 'Role', - using => { - name => 'migrations', - description => 'database migrations user - DO NOT REMOVE', - priv_level => '20', - }, - }, - ## id => 4 '3' => { new => 'Role', using => { @@ -62,7 +50,6 @@ my %definition_for = ( priv_level => '20', }, }, - ## id => 5 '4' => { new => 'Role', using => { @@ -71,7 +58,6 @@ my %definition_for = ( priv_level => '2', }, }, - ## id => 6 '5' => { new => 'Role', using => { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/lib/Fixtures/Role.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/Fixtures/Role.pm b/traffic_ops/app/lib/Fixtures/Role.pm index c87dc5b..c0b85d0 100644 --- a/traffic_ops/app/lib/Fixtures/Role.pm +++ b/traffic_ops/app/lib/Fixtures/Role.pm @@ -32,7 +32,7 @@ my %definition_for = ( new => 'Role', using => { id => 2, - name => 'read-only user', + name => 'read-only', description => 'block all access', priv_level => 10, }, @@ -64,15 +64,6 @@ my %definition_for = ( priv_level => 30, }, }, - migrations => { - new => 'Role', - using => { - id => 5, - name => 'migrations', - description => 'database migrations user - DO NOT REMOVE', - priv_level => 20, - }, - }, portal => { new => 'Role', using => { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/lib/Fixtures/TmUser.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/Fixtures/TmUser.pm b/traffic_ops/app/lib/Fixtures/TmUser.pm index cbb546b..35f82e7 100644 --- a/traffic_ops/app/lib/Fixtures/TmUser.pm +++ b/traffic_ops/app/lib/Fixtures/TmUser.pm @@ -97,31 +97,6 @@ my %definition_for = ( registration_sent => '1999-01-01 00:00:00', }, }, - migrations => { - new => 'TmUser', - using => { - id => 400, - username => 'migration', - tenant_id => undef, - role => 5, - uid => '1', - gid => '1', - local_passwd => $local_passwd, - confirm_local_passwd => $local_passwd, - full_name => 'The migrations User', - email => 'migrat...@kabletown.com', - new_user => '1', - address_line1 => 'address_line1', - address_line2 => 'address_line2', - city => 'city', - state_or_province => 'state_or_province', - phone_number => '111-111-1111', - postal_code => '80122', - country => 'United States', - token => '', - registration_sent => '1999-01-01 00:00:00', - }, - }, federation => { new => 'TmUser', using => { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c3dfa4b3/traffic_ops/app/t/api/1.1/roles.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.1/roles.t b/traffic_ops/app/t/api/1.1/roles.t index 2b21e45..d1164ff 100644 --- a/traffic_ops/app/t/api/1.1/roles.t +++ b/traffic_ops/app/t/api/1.1/roles.t @@ -39,9 +39,13 @@ ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_USER, p => T ->or( sub { diag $t->tx->res->content->asset->{content}; } ); $t->get_ok('/api/1.1/roles.json?orderby=name')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } ) - ->json_is( "/response/0/id", "4" )->json_is( "/response/0/description", "super-user" )->json_is( "/response/0/name", "admin" ) - ->json_is( "/response/0/privLevel", "30" )->json_is( "/response/6/description", "block all access" )->json_is( "/response/6/name", "read-only user" ) - ->json_is( "/response/6/privLevel", "10" ); + ->json_is( "/response/0/id", "4" ) + ->json_is( "/response/0/description", "super-user" ) + ->json_is( "/response/0/name", "admin" ) + ->json_is( "/response/0/privLevel", "30" ) + ->json_is( "/response/6/description", "Role for Steering Delivery Service" ) + ->json_is( "/response/6/name", "steering" ) + ->json_is( "/response/6/privLevel", "11" ); ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } ); $dbh->disconnect();