% def fk_action_color action case action when 'CASCADE' 'negative' when 'SET NULL' 'warning' end end %>
<%= params["schema"] %>.<%= params["name"] %>
<%= object[:comment] %>
<% end %> <%= render_markdown "schema/#{params["schema"]}/#{params["name"]}.md" %>Column Name | Data Type | Required Field? | Default Value | <% object[:columns].each do |row| %>
---|---|---|---|
<% if fk = object[:foreign_keys].fetch(row["column_name"], nil) %> " title="<%= fk["references_schema"] %>.<%= fk["references_table"] %>"><%= row["column_name"] %> <% else %> <%= row["column_name"] %> <% end %> | <%= row["data_type"] %> | "><%= row["is_nullable"] == 'NO' ? '' : ''%> | <%= row["column_default"] %> |
Column Name | References | On Delete | Constraint Name | <% object[:foreign_keys].each do |column_name, row| %>
---|---|---|---|
<%= row["column_name"] %> | " title="<%= row["references_schema"] %>.<%= row["references_table"] %>"><%= "#{row["references_schema"]}.#{row["references_table"]}" %> | "><%= row["on_delete"] %> | <%= row["constraint_name"] %> |
Index Name | Primary? | Unique? | Type | Columns | <% object[:indexes].each do |index_name, row| %>
---|---|---|---|---|
<%= row["index_name"] %> | <% if row["is_primary"] == "t" %><% end %> | <% if row["is_unique"] == "t" %><% end %> | <%= row["index_type"] %> | <%= row["index_keys"][1..-2].split(",").join ", " %> |