Sha256: 8a776e68e2a013b894ca1e572b8437f7304c5664318f86bb7cb80ff6d04f012c

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

#!/usr/bin/env ruby

require 'builder/builder.rb'

module Prick::SubCommand
  def self.teardown(database, username)
    conn = PgConn.new "postgres" # Superuser connection
    if conn.rdbms.exist? database
      conn.rdbms.drop database, force: true
    end
    if conn.role.exist? username
      conn.role.drop username, cascade: true
    end

    # TODO Run builder teardown scrips
#   builder = Prick::Build::Builder.new(conn, "schema")
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
prick-0.29.1 lib/prick/subcommand/prick-teardown.rb
prick-0.29.0 lib/subcommand/prick-teardown.rb
prick-0.28.1 lib/subcommand/prick-teardown.rb
prick-0.28.0 lib/subcommand/prick-teardown.rb
prick-0.27.2 lib/subcommand/prick-teardown.rb