Why table names are different in Devart?

Why table names are different in Devart?

Postby Husniddin » Fri 28 Aug 2015 13:00

Hi Devart support team,

During using table names in DB for Role provider, Devart needs to use this like of table_names: aspnet_users,aspnet_usersinroles,aspnet_roles.

Code: Select all
SELECT rolename from aspnet_users u, aspnet_roles r, aspnet_usersinroles ur WHERE LOWER(u.applicationname) = $1 AND LOWER(r.applicationname) = LOWER(u.applicationname) AND u.userid = ur.userid AND r.roleid = ur.roleid AND LOWER(username) = $2


For Identity (for registering,signing to the web) Devart needs to use : AspNetUsers, AspNetRoles, AspNetUserRoles.
Here is Code from C:\Program Files (x86)\Devart\dotConnect\PostgreSQL\Web\ASP.NET Identity 1 :
Code: Select all

CREATE TABLE "AspNetRoles" (
  "Id" varchar(128) NOT NULL,
  "Name" varchar(256) NOT NULL,
  PRIMARY KEY ("Id")
);

CREATE TABLE "AspNetUsers" (
  "Id" varchar(128) NOT NULL,
  "UserName" varchar(256) NOT NULL,
  "PasswordHash" varchar(256) NULL,
  "SecurityStamp" varchar(256) NULL,
  PRIMARY KEY ("Id")
);

CREATE TABLE "AspNetUserClaims" (
  "Id" serial NOT NULL,
  "ClaimType" varchar(256) NULL,
  "ClaimValue" varchar(256) NULL,
  "UserId" varchar(128) NOT NULL,
  PRIMARY KEY ("Id")
);

CREATE TABLE "AspNetUserLogins" (
  "UserId" varchar(128) NOT NULL,
  "LoginProvider" varchar(128) NOT NULL,
  "ProviderKey" varchar(128) NOT NULL,
  PRIMARY KEY ("UserId", "LoginProvider", "ProviderKey")
);

CREATE TABLE "AspNetUserRoles" (
  "UserId" varchar(128) NOT NULL,
  "RoleId" varchar(128) NOT NULL,
  PRIMARY KEY ("UserId", "RoleId")
);

CREATE INDEX "IX_AspNetUserClaims_UserId" ON "AspNetUserClaims" ("UserId");

CREATE INDEX "IX_AspNetUserLogins_UserId" ON "AspNetUserLogins" ("UserId");

CREATE INDEX "IX_AspNetUserRoles_RoleId" ON "AspNetUserRoles" ("RoleId");

CREATE INDEX "IX_AspNetUserRoles_UserId" ON "AspNetUserRoles" ("UserId");

ALTER TABLE "AspNetUserClaims"
  ADD CONSTRAINT "FK_AspNetUserClaims_AspNetUsers_User_Id" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id")
  ON DELETE CASCADE;

ALTER TABLE "AspNetUserLogins"
  ADD CONSTRAINT "FK_AspNetUserLogins_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id")
  ON DELETE CASCADE;

ALTER TABLE "AspNetUserRoles"
  ADD CONSTRAINT "FK_AspNetUserRoles_AspNetRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AspNetRoles" ("Id")
  ON DELETE CASCADE;

ALTER TABLE "AspNetUserRoles"
  ADD CONSTRAINT "FK_AspNetUserRoles_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id")
  ON DELETE CASCADE;



Now I've two type of table names in DB : tables names with mixed case(AspnetUsers) and table names with lower case(aspnet_users)

Why are there different?? Or How can I solve this problem?

Thank you!
Last edited by Husniddin on Tue 01 Sep 2015 07:40, edited 1 time in total.
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26

Re: Why table names are different in Devart?

Postby Pinturiccio » Mon 31 Aug 2015 13:40

ASP.NET Identity and ASP.NET 2.0 Provider Model are two different matters and they use different database schemas.

You need to select the ASP.NET Web Providers check box when installing the provider in order to work with ASP.NET 2.0 Provider Model. dotConnect for Oracle will be installed with the Devart.Data.Oracle.Web.dll assembly and the InstallWebTables.sql file, which are installed to the following folder by default: C:\Program Files (x86)\Devart\dotConnect\Oracle\Web\ASP.NET 2\

As for ASP.NET Identity, you need to select the ASP.NET Identity check box when installing the provider. dotConnect for Oracle will be installed with the Devart.Data.Oracle.Web.Identity.dll assembly and the Install_identity_tables.sql file, which are installed to the following folder by default: C:\Program Files (x86)\Devart\dotConnect\Oracle\Web\ASP.NET Identity 1\

ASP.NET Identity and ASP.NET 2.0 Provider Model use different assemblies and different schemas. For more information, please refer to
https://www.devart.com/dotconnect/oracle/docs/?AspProviders.html
https://www.devart.com/dotconnect/oracle/docs/?Identity-Tutorial-Entity.html
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: Why table names are different in Devart?

Postby Husniddin » Tue 01 Sep 2015 13:10

Pinturiccio wrote:ASP.NET Identity and ASP.NET 2.0 Provider Model are two different matters and they use different database schemas.

You need to select the ASP.NET Web Providers check box when installing the provider in order to work with ASP.NET 2.0 Provider Model. dotConnect for Oracle will be installed with the Devart.Data.Oracle.Web.dll assembly and the InstallWebTables.sql file, which are installed to the following folder by default: C:\Program Files (x86)\Devart\dotConnect\Oracle\Web\ASP.NET 2\

As for ASP.NET Identity, you need to select the ASP.NET Identity check box when installing the provider. dotConnect for Oracle will be installed with the Devart.Data.Oracle.Web.Identity.dll assembly and the Install_identity_tables.sql file, which are installed to the following folder by default: C:\Program Files (x86)\Devart\dotConnect\Oracle\Web\ASP.NET Identity 1\

ASP.NET Identity and ASP.NET 2.0 Provider Model use different assemblies and different schemas. For more information, please refer to
https://www.devart.com/dotconnect/oracle/docs/?AspProviders.html
https://www.devart.com/dotconnect/oracle/docs/?Identity-Tutorial-Entity.html



All working now with out Exception, but I've two types of tables in Database :
1) With mixed cases: "AspNetUsers". (This table is using for Identity)
2) With lower cases: "aspnet_users", "aspnet_roles","aspnet_usersinroles" .(This tables are using for provider , with out this tables Visual Studio show exception that missing these tables )
I'm using PostgreSQL

is it TRUE that in one DB make two type of table names or I must choose only one of them?
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26

Re: Why table names are different in Devart?

Postby Pinturiccio » Wed 02 Sep 2015 13:20

Husniddin wrote:is it TRUE that in one DB make two type of table names or I must choose only one of them?

You can use these tables in one database because they have different names, and case is not the only difference.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL