Though most Rails developers do not like to keep constraints in the database, you should consider things like nullable columns.
虽然大多数Rails开发人员都不喜欢在数据库中保留限制,但您应该考虑像空列这样的事情。
However ElectricityDeal had too many of its own properties. Accordingly many electricity-specific nullable columns were added to the Deal table.
但是ElectricityDeal有太多自己的属性,因此有很多电相关的可空字段加入了Deal表。
The pros include compact tables (no unnecessary nullable columns), data partitions across three subclass tables and easy association with other tables using the top super class table.
优点包括数据表比较紧凑(没有不需要的可空字段),数据跨三个子类的表进行分区,容易使用超类的表与其他表进行关联。
应用推荐