Class: PGAssets::PGConstraint
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PGAssets::PGConstraint
- Includes:
- LoadableAsset
- Defined in:
- lib/pg_assets/models/pg_constraint.rb
Instance Method Summary collapse
Instance Method Details
#identity ⇒ Object
17 18 19 |
# File 'lib/pg_assets/models/pg_constraint.rb', line 17 def identity "#{conname} on #{get_table_name}" end |
#sql_for_reinstall ⇒ Object
25 26 27 |
# File 'lib/pg_assets/models/pg_constraint.rb', line 25 def sql_for_reinstall sql = "#{sql_for_remove}; ALTER TABLE #{get_table_name} ADD CONSTRAINT #{conname} #{cached_defn}" end |
#sql_for_remove ⇒ Object
21 22 23 |
# File 'lib/pg_assets/models/pg_constraint.rb', line 21 def sql_for_remove sql = "ALTER TABLE #{get_table_name} DROP CONSTRAINT IF EXISTS #{conname}" end |