Skip to content

Commit

Permalink
Feature/bool db column urls (#172)
Browse files Browse the repository at this point in the history
* SRCH-179 - Add a boolean column to the searchgov_urls

* update structure.sql

* migration file for enqueued for reindex to searachgov_url

* update migration, update test cases

* typo

* remove extra space

* migrated database
  • Loading branch information
peggles2 committed Nov 21, 2018
1 parent 28cf52f commit 9b519a9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class AddEnqueuedForReindexToSearchgovUrls < ActiveRecord::Migration
def change
add_column :searchgov_urls,
:enqueued_for_reindex,
:boolean,
default: false, null: false
end
end
9 changes: 6 additions & 3 deletions db/structure.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.11 (x86_64)
-- MySQL dump 10.13 Distrib 5.6.41, for osx10.13 (x86_64)
--
-- Host: localhost Database: usasearch_development
-- ------------------------------------------------------
-- Server version 5.6.35
-- Server version 5.6.41

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -1157,6 +1157,7 @@ CREATE TABLE `searchgov_urls` (
`updated_at` datetime NOT NULL,
`searchgov_domain_id` int(11) DEFAULT NULL,
`lastmod` datetime DEFAULT NULL,
`enqueued_for_reindex` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_searchgov_urls_on_url` (`url`(255)),
KEY `index_searchgov_urls_on_searchgov_domain_id` (`searchgov_domain_id`),
Expand Down Expand Up @@ -1562,7 +1563,7 @@ CREATE TABLE `youtube_profiles` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-07-12 9:43:35
-- Dump completed on 2018-11-16 9:52:13
INSERT INTO schema_migrations (version) VALUES ('20090818003200');

INSERT INTO schema_migrations (version) VALUES ('20090827135344');
Expand Down Expand Up @@ -3003,3 +3004,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180611171416');

INSERT INTO schema_migrations (version) VALUES ('20180621213347');

INSERT INTO schema_migrations (version) VALUES ('20181109212904');

4 changes: 3 additions & 1 deletion spec/models/searchgov_url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
with_options(null: false, limit: 2000) }
it { is_expected.to have_db_column(:load_time).of_type(:integer) }
it { is_expected.to have_db_column(:lastmod).of_type(:datetime) }

it { is_expected.to have_db_column(:enqueued_for_reindex).
of_type(:boolean).
with_options(default: false, null: false) }
it { is_expected.to have_db_index(:url) }
end

Expand Down

0 comments on commit 9b519a9

Please sign in to comment.