{"action":"created","issue":{"url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/58","repository_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator","labels_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/58/comments","events_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/58/events","html_url":"https://github.com/Kononnable/typeorm-model-generator/issues/58","id":315029669,"number":58,"title":"Entities created with no @PrimaryColumn","user":{"login":"ithav","id":9445082,"avatar_url":"https://avatars1.githubusercontent.com/u/9445082?v=4","gravatar_id":"","url":"https://api.github.com/users/ithav","html_url":"https://github.com/ithav","followers_url":"https://api.github.com/users/ithav/followers","following_url":"https://api.github.com/users/ithav/following{/other_user}","gists_url":"https://api.github.com/users/ithav/gists{/gist_id}","starred_url":"https://api.github.com/users/ithav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithav/subscriptions","organizations_url":"https://api.github.com/users/ithav/orgs","repos_url":"https://api.github.com/users/ithav/repos","events_url":"https://api.github.com/users/ithav/events{/privacy}","received_events_url":"https://api.github.com/users/ithav/received_events","type":"User","site_admin":false},"labels":[{"id":567812555,"url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-17T12:05:40Z","updated_at":"2018-04-19T06:36:14Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI managed to generate my existing mySql entities with this command:\r\n_typeorm-model-generator -h localhost -d myschema -u myUser -x myPass -e mysql --cf camel --ce pascal --cp camel --output ./data/entities --noConfig true_\r\n\r\nThe problem is that none of them are generated with @PrimaryColumn and so typeorm cannot use them.\r\n\r\nat early attempt I was getting:\r\n_Table my_aspnet_schemaversion has no PK._ just for that table and so I've added PK and the message was gone on the next attempt.\r\nyet, the @PrimaryColumn was not generated to any table.\r\n\r\nhere is one generated entity that was created:\r\n\r\n```\r\nimport {Index,Entity, PrimaryColumn, Column, OneToOne, OneToMany, ManyToOne, ManyToMany, JoinColumn, JoinTable} from \"typeorm\";\r\nimport {Codes} from \"./codes\";\r\n\r\n@Entity(\"pricing\")\r\n@Index(\"pricing_type\",[\"Type\",])\r\nexport class Pricing {\r\n\r\n    @Column(\"varchar\",{ \r\n        nullable:false,\r\n        length:50,\r\n        primary:true,\r\n        name:\"Id\"\r\n        })\r\n    id:string;\r\n           \r\n    @ManyToOne(type=>Codes, type=>type.pricings)\r\n    @JoinColumn({ name:'Type'})\r\n    type:Codes;\r\n    \r\n    @Column(\"text\",{ \r\n        nullable:true,\r\n        name:\"Properties\"\r\n        })\r\n    properties:string;\r\n        \r\n    @Column(\"varchar\",{ \r\n        nullable:true,\r\n        length:50,\r\n        name:\"Description\"\r\n        })\r\n    description:string;\r\n        \r\n}\r\n```\r\n\r\nand there is the DDL of that DB table:\r\n```\r\nCREATE TABLE `pricing` (\r\n\t`Id` VARCHAR(50) NOT NULL,\r\n    `Type` int(11) NOT NULL,\r\n    `Properties` TEXT DEFAULT NULL,\r\n    `Description` VARCHAR(50) DEFAULT NULL,\r\n    PRIMARY KEY (`Id`),\r\n    CONSTRAINT `pricing_type` FOREIGN KEY (`Type`) REFERENCES `codes` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n```\r\n\r\nThe versions I am using:\r\nMySql server 5.7.17\r\n\r\nnode modules:\r\ntypeorm@0.1.21\r\ntypeorm-model-generator@0.2.12\r\nmysql@2.15.0\r\n\r\nYour help is very appreciated.\r\n\r\nThanks\r\nIthav\r\n"},"comment":{"url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/comments/382626556","html_url":"https://github.com/Kononnable/typeorm-model-generator/issues/58#issuecomment-382626556","issue_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/58","id":382626556,"user":{"login":"ithav","id":9445082,"avatar_url":"https://avatars1.githubusercontent.com/u/9445082?v=4","gravatar_id":"","url":"https://api.github.com/users/ithav","html_url":"https://github.com/ithav","followers_url":"https://api.github.com/users/ithav/followers","following_url":"https://api.github.com/users/ithav/following{/other_user}","gists_url":"https://api.github.com/users/ithav/gists{/gist_id}","starred_url":"https://api.github.com/users/ithav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithav/subscriptions","organizations_url":"https://api.github.com/users/ithav/orgs","repos_url":"https://api.github.com/users/ithav/repos","events_url":"https://api.github.com/users/ithav/events{/privacy}","received_events_url":"https://api.github.com/users/ithav/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T06:36:14Z","updated_at":"2018-04-19T06:36:14Z","author_association":"NONE","body":"@Kononnable thanks so much!\r\nI'm validating the fix and will report back soon."}}
{"actor":{"display_login":"ithav"}}