vendor/plugins/enum-column/lib/enum/postgresql_adapter.rb
# Add constraints to the list of columns. This will only pick up check constraints.
# We'll filter the constraint for the column type and ANY ((ARRAY[ type.
Add constraints to the list of columns. This will only pick up check constraints.
We'll filter the constraint for the column type and ANY ((ARRAY[ type.
Add constraints to the list of columns . This will only pick up check constraints . We ' ll filter the constraint for the column type and ANY (( ARRAY [ type .
def column_definitions(table_name)
        query <<-end_sql
          SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull, c.consrc
            FROM pg_attribute a LEFT JOIN pg_attrdef d
              ON a.attrelid = d.adrelid AND a.attnum = d.adnum
              LEFT JOIN pg_constraint c ON a.attrelid = c.conrelid AND 
                c.contype = 'c' AND c.conkey[1] = a.attnum
            WHERE a.attrelid = '#{table_name}'::regclass
              AND a.attnum > 0 AND NOT a.attisdropped
            ORDER BY a.attnum
        end_sql
      end
def column_definitions ( table_name ) query <<-end_sql 
          SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull, c.consrc
            FROM pg_attribute a LEFT JOIN pg_attrdef d
              ON a.attrelid = d.adrelid AND a.attnum = d.adnum
              LEFT JOIN pg_constraint c ON a.attrelid = c.conrelid AND 
                c.contype = 'c' AND c.conkey[1] = a.attnum
            WHERE a.attrelid = ' #{ table_name } '::regclass
              AND a.attnum > 0 AND NOT a.attisdropped
            ORDER BY a.attnum
         end_sql end
Add constraints to the list of columns.
Add constraints to the list of columns .
table_name