Wufoo的数据库模式 - 你会如何设计它?

时间:2022-10-09 13:00:00

Wufoo is a:

Wufoo是:

HTML form builder that helps you create contact forms, online surveys, and invitations so you can collect the data, registrations and online payments you need without writing a single line of code.

HTML表单构建器,可帮助您创建联系表单,在线调查和邀请,以便您可以收集所需的数据,注册和在线支付,而无需编写任何代码。

How would you approach the database design if building a similar site?

如果构建类似的站点,您将如何处理数据库设计?

Higher level designs (tables and relationships) or Lower level designs (tables, relationships, fields, views, rules, MySQl queries, etc)... are all welcome :-)

更高级别的设计(表格和关系)或更低级别的设计(表格,关系,字段,视图,规则,MySQl查询等)......都欢迎:-)

MySQL based solutions preferred ;-)

基于MySQL的解决方案首选;-)

1 个解决方案

#1


9  

This type of database design calls for EAV tables. For example, the form section probably contains:

这种类型的数据库设计需要EAV表。例如,表单部分可能包含:

1. User table (user_id, user_name, etc.)
2. Form table (user_id, form_id, form_name, etc.)
3. Form_field table (form_id, column_id, column_name, column_type, etc.)
4. column_type table (column_type_id, column_type_name)

Filled in results will be saved in a different table:

填写结果将保存在不同的表格中:

Filled_form (form_id, column_id, value)

The idea is to create a database model that is just generic enough (but no more than) needed, in order to accommodate for the needs of different users. For example, the column types are set by the programmers, and each type has a different meaning when rendering the form.

我们的想法是创建一个只需要通用(但不超过)通用的数据库模型,以满足不同用户的需求。例如,列类型由程序员设置,每种类型在呈现表单时具有不同的含义。

#1


9  

This type of database design calls for EAV tables. For example, the form section probably contains:

这种类型的数据库设计需要EAV表。例如,表单部分可能包含:

1. User table (user_id, user_name, etc.)
2. Form table (user_id, form_id, form_name, etc.)
3. Form_field table (form_id, column_id, column_name, column_type, etc.)
4. column_type table (column_type_id, column_type_name)

Filled in results will be saved in a different table:

填写结果将保存在不同的表格中:

Filled_form (form_id, column_id, value)

The idea is to create a database model that is just generic enough (but no more than) needed, in order to accommodate for the needs of different users. For example, the column types are set by the programmers, and each type has a different meaning when rendering the form.

我们的想法是创建一个只需要通用(但不超过)通用的数据库模型,以满足不同用户的需求。例如,列类型由程序员设置,每种类型在呈现表单时具有不同的含义。