0

关于 laravel 中模式设计的快速问题。这是我的用户表的当前模式。现在我想添加完整的用户信息,这意味着向某人收费所需的所有信息、名字、姓氏、地址等。

在 laravel 中添加表数据的标准方法是什么?我会创建一个迁移以将列添加到这个迁移。或者回滚这个迁移并用添加的列重写它?

    public function up()
    {
        Schema::create('users', function($table) {
            $table->increments('id');
            $table->string('username');
            $table->string('email');
            $table->string('password');
            $table->boolean('activated')->default(0);
            $table->timestamps();
        });
    }

Is there a drawback to either method? Also I'm wondering I'm adding about 9 extra columns for all the added info wich would make my Users table quite large, although it's not necessary at the moment would It be better to put this extra info in another table?

In total this Users table would end up with about 16 columns or so, will this have any negative impact on performance?

Might be some stupid questions, but I don't have a lot of experiences with larger database schema's.

4

1 回答 1

1

如果您回滚此表,您将删除该表,我不建议这样做,我会将新列添加到现有表中。否则,如果您决定不需要这些附加信息,您将删除 users 表。

于 2013-04-30T11:17:53.647 回答