Table: dbfiles
Legend: Primary key columns Indexed columns
Column Type Size Nulls Auto Default References Comments
id bigserial 19  χ   √  nextval('dbfiles_id_seq'::regclass)
file_name varchar 255  χ   χ 
file_path varchar 255  χ   χ 
md5 varchar 255  √   χ  null
created_user_id int8 19  √   χ  null users.id
updated_user_id int8 19  √   χ  null users.id
machine_id int8 19  χ   χ  machines.id
created_at timestamp 29,6  √   χ  utc_now()
updated_at timestamp 29,6  √   χ  utc_now()
container_type varchar 255  √   χ  null this and container_id are part of a polymorphic relationship, specifies table and primary key of that table
container_id int8 19  √   χ  null
Indexes:
Column(s) Type Sort Constraint Name
id Primary key Asc dbfiles_pkey
container_type Performance Asc index_dbfiles_on_container_id_and_container_type
created_user_id Performance Asc index_dbfiles_on_created_user_id
machine_id Performance Asc index_dbfiles_on_machine_id
updated_user_id Performance Asc index_dbfiles_on_updated_user_id
file_name + file_path + machine_id Must be unique Asc/Asc/Asc unique_filename_and_path_per_machine