Hi all!
When i create a model first, it seems that upon generation all my fields are getting spliced and underscored.
So for example, i have a field called 'EmployeeID', but when i generate code to update the DB, it gets named 'Employee_I_D' etc.
Attached is a picture of the tables i want to create, below is the result that gets generated.
Could somebody please help me out here? It also does it with fields like 'Date_OUT' -> 'Date_O_U_T' etc.
Thanks!!
Generated code:
-- DGP.ASP.Employee
CREATE TABLE [Employee] (
[surname] varchar(255) NULL, -- _surname
[street] varchar(255) NULL, -- _street
[resource_i_d] int NULL, -- _resources
[postalcode] varchar(255) NULL, -- _postalcode
[numbr] varchar(255) NULL, -- _number
[nme] varchar(255) NULL, -- _name
[is_active] tinyint NOT NULL, -- _isActive
[CategoryID] int NULL, -- _humanTypes
[floor] varchar(255) NULL, -- _floor
[EmployeeID] int IDENTITY NOT NULL, -- _employeeID
[date_o_u_t] datetime NOT NULL, -- _dateOUT
[date_i_n] datetime NOT NULL, -- _dateIN
[country] varchar(255) NULL, -- _country
[city] varchar(255) NULL, -- _city
[birthplace] varchar(255) NULL, -- _birthplace
[birthdate] varchar(255) NULL, -- _birthdate
CONSTRAINT [pk_Employee] PRIMARY KEY ([EmployeeID])
)
go
-- DGP.ASP.Communication
CREATE TABLE [communication] (
[typ] varchar(255) NULL, -- _type
[primary] tinyint NOT NULL, -- _primary
[employee_i_d] int NULL, -- _employee
[content] varchar(255) NULL, -- _content
[communication_i_d] int NOT NULL, -- _communicationID
CONSTRAINT [pk_communication] PRIMARY KEY ([communication_i_d])
)
go
-- DGP.ASP.Human_Types
CREATE TABLE [human__types] (
[titel] varchar(255) NULL, -- _titel
[main_type_i_d] int NOT NULL, -- MainTypeID
[description] varchar(255) NULL, -- _description
CONSTRAINT [pk_human__types] PRIMARY KEY ([main_type_i_d])
)
go
-- DGP.ASP.Resources
CREATE TABLE [resources] (
[titel] varchar(255) NULL, -- _titel
[resource_i_d] int NOT NULL, -- ResourceID
[description] varchar(255) NULL, -- _description
CONSTRAINT [pk_resources] PRIMARY KEY ([resource_i_d])
)
go
CREATE INDEX [idx_Employee_CategoryID] ON [Employee]([CategoryID])
go
CREATE INDEX [idx_Employee_resource_i_d] ON [Employee]([resource_i_d])
go
CREATE INDEX [idx_communication_employee_i_d] ON [communication]([employee_i_d])
go
ALTER TABLE [Employee] ADD CONSTRAINT [ref_Employee_human__types] FOREIGN KEY ([CategoryID]) REFERENCES [human__types]([main_type_i_d])
go
ALTER TABLE [Employee] ADD CONSTRAINT [ref_Employee_resources] FOREIGN KEY ([resource_i_d]) REFERENCES [resources]([resource_i_d])
go
ALTER TABLE [communication] ADD CONSTRAINT [ref_communication_Employee] FOREIGN KEY ([employee_i_d]) REFERENCES [Employee]([EmployeeID])
go