FOSUserBundle icon indicating copy to clipboard operation
FOSUserBundle copied to clipboard

question about update entity to database schema.

Open thewbb opened this issue 13 years ago • 10 comments

I did step 1~6 what the Getting Started With FOSUserBundle said. and I do step 7 : doctrine:schema:update --dump-sql
create a table just have id field, SQL is:CREATE TABLE fos_user (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB

but,I see the FOSUserBundle video, that create a table with a lot of fields become extend from FOS\UserBundle\Model\User table.

how can I create the table to database with thats fields?

// APIbundle/entity/User.php

thewbb avatar Sep 05 '13 04:09 thewbb

The same for me. Here are my versions of bundles.

l 0jl95k-ptc

vaclavn avatar Sep 05 '13 10:09 vaclavn

Which version of the bundle are you using ?

stof avatar Sep 05 '13 10:09 stof

I have done that my self. the reason is this line :use FOS\UserBundle\Model\User as BaseUser; I use ORM entity, so:use FOS\UserBundle\Entity\User as BaseUser; extend from entity baseclass is right way.

thewbb avatar Sep 06 '13 02:09 thewbb

thewbb: Thank you! :)

vaclavn avatar Sep 06 '13 06:09 vaclavn

I have tried to make a pull request: https://github.com/FriendsOfSymfony/FOSUserBundle/pull/1255

vaclavn avatar Sep 06 '13 06:09 vaclavn

@thewbb No it is not, when using the master branch of the bundle. The right way is to read the doc for the version of the bundle you use, hence my question above

stof avatar Sep 06 '13 07:09 stof

@stof I see, so maybe it is a little bit confusing that the main Readme.md links master doc not current docs. I mean this isn't fault of FOSUserBundle but it could be less confusing. Thank you for you time.

vaclavn avatar Sep 06 '13 08:09 vaclavn

@VeN Well, there is no "current" doc. There is a doc for what you use. For people using master, the link is right.

stof avatar Sep 06 '13 08:09 stof

I added a link to the 1.3.x doc too. But the existing link was explicitly saying it was the doc for master

stof avatar Sep 06 '13 08:09 stof

thanks,my fosuserbundle is ver1.3,i get the rong document. entity for 1.3 model for 2.0 master

thewbb avatar Sep 08 '13 13:09 thewbb