Skip to content

Commit

Permalink
EN-12742 Add capability to disable a secondary instance from reading …
Browse files Browse the repository at this point in the history
…a dataset

update dataset_internal_name_map set disabled to now()
  • Loading branch information
chitang committed Dec 31, 2016
1 parent 6716fcb commit 53a77e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
<changeSet author="chi" id="20161231-add-disabled">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="dataset_internal_name_map" columnName="disabled"/></not>
</preConditions>
<addColumn tableName="dataset_internal_name_map">
<column name="disabled" type="timestamp with timezone"/>
</addColumn>
</changeSet>
</databaseChangeLog>
Expand Up @@ -12,5 +12,6 @@
<include file="com/socrata/pg/store/schema/20160107-create-computation-strategy-map.xml"/>
<include file="com/socrata/pg/store/schema/20160111-add-field-name-columns.xml"/>
<include file="com/socrata/pg/store/schema/20160420-add-copy-map-table-modifiers.xml"/>
<include file="com/socrata/pg/store/schema/20161231-add-disabled.xml"/>

</databaseChangeLog>
Expand Up @@ -9,6 +9,7 @@ class PGSecondaryDatasetMapReader(val conn: Connection) {
"""SELECT dataset_system_id
| FROM dataset_internal_name_map
| WHERE dataset_internal_name = ?
| AND disabled is null
""".stripMargin
def datasetIdForInternalName(datasetInternalName: String): Option[DatasetId] = {
using(conn.prepareStatement(idFromName)) { stmt =>
Expand Down

0 comments on commit 53a77e0

Please sign in to comment.