Permalink
Browse files

Drop all sources (and deps and runs) from non-git:// sources, and add…

… a check constraint to ensure only runs from git:// sources can be tracked.
  • Loading branch information...
1 parent c84053b commit 466e9174f79d940cb5a99ef7b87fe4c19d905c79 @benhoskings committed Aug 21, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 db/migrate/20120821080927_restrict_source_uri_to_git.rb
@@ -0,0 +1,9 @@
+class RestrictSourceUriToGit < ActiveRecord::Migration
+ def up
+ Source.where("uri !~ '^git'").each(&:destroy)
+
+ execute <<-SQL
+ ALTER TABLE sources ADD CHECK (uri ~ '^git')
+ SQL
+ end
+end

0 comments on commit 466e917

Please sign in to comment.