Is there a reason, not to make AbpUsers.tenantId a foreignKey?How to make composite unique key in ASP.NET Boilerplate?AdminBSB - how to make modal forms widerImplementation of Hard Delete for Entity which is being referred in other entityHow to make use of Castle.MicroKernel.Registration.Lifestyle.PerWebRequest within Abp?How to make Castle Windsor TraceLoggerFactory output to Visual Studio output window?What is the reason behind reloading the entire page when changing tenants?How to make an Abp.Dapper multiple-table query?how to make a paid feature in Asp.Net Zerohow make progress in abp project mvc5How to sign in a non existing user? How to make a mock (dummy) user to sign-in Web.Mvc (UI) project that doesn't have a connection string?

Manager manipulates my leaves, what's in it for him?

Are lay articles good enough to be the main source of information for PhD research?

Dead or alive (First time)

How could artificial intelligence harm us?

Regular Expressions with `<` and `?` strange matches

Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?

Tips for remembering the order of parameters for ln?

As a discovery writer, how to complete unfinished novel (which is highly diverted from original plot ) after a time-gap

Dear Fellow PSE Users,

What did the controller say during my approach to land (audio clip)?

Did HaShem ever command a Navi (Prophet) to break a law?

Paradox regarding phase transitions in relativistic systems

Why is the stock market so unpredictable?

Applications of mathematics in clinical setting

Why do things cool down?

Is it safe to unplug a blinking USB drive after 'safely' ejecting it?

Madrid to London w/ Expired 90/180 days stay as US citizen

EU compensation - fire alarm at the Flight Crew's hotel

siunitx redefines macros in pdf bookmarks

Unable to see packet drops on tunnels

Can one guy with a duplicator initiate a nuclear apocalypse?

How do rulers get rich from war?

What was the deeper meaning of Hermione wanting the cloak?

Twelve Minesweeper mines that make twelve 4s



Is there a reason, not to make AbpUsers.tenantId a foreignKey?


How to make composite unique key in ASP.NET Boilerplate?AdminBSB - how to make modal forms widerImplementation of Hard Delete for Entity which is being referred in other entityHow to make use of Castle.MicroKernel.Registration.Lifestyle.PerWebRequest within Abp?How to make Castle Windsor TraceLoggerFactory output to Visual Studio output window?What is the reason behind reloading the entire page when changing tenants?How to make an Abp.Dapper multiple-table query?how to make a paid feature in Asp.Net Zerohow make progress in abp project mvc5How to sign in a non existing user? How to make a mock (dummy) user to sign-in Web.Mvc (UI) project that doesn't have a connection string?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I was querying against SQL Server to get all columns, that are referenced to other columns. By accident I saw, that the column "tenantId" (table "AbpUsers") is not referenced to AbpTenants.Id.



I asked some of my collegues, that are "used" to know aspnetboilerplate, just to clarify. Everyone was surprised, as I am.



Just for testing purposes I created a new database by "Update-database". Before running the application, I added the "missing" foreign-Key-reference manually. And? Nothing happened. Nothing bad happened. Everything works, as it did without the foreign-key-reference...



ALTER TABLE [dbo].[AbpUsers] WITH CHECK ADD CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId] FOREIGN KEY([TenantId])
REFERENCES [dbo].[AbpTenants] ([Id])
GO

ALTER TABLE [dbo].[AbpUsers] CHECK CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId]
GO


As expected my whole application works fine, even when the initial content builder is running.










share|improve this question
























  • Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

    – aaron
    Mar 28 at 14:35











  • @aaron: Thanks. Even if I was hoping to get another answer... :-)

    – normand.bellemare
    Mar 28 at 15:42











  • Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

    – GGleGrand
    Apr 9 at 14:29












  • my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

    – normand.bellemare
    Apr 11 at 6:12

















1















I was querying against SQL Server to get all columns, that are referenced to other columns. By accident I saw, that the column "tenantId" (table "AbpUsers") is not referenced to AbpTenants.Id.



I asked some of my collegues, that are "used" to know aspnetboilerplate, just to clarify. Everyone was surprised, as I am.



Just for testing purposes I created a new database by "Update-database". Before running the application, I added the "missing" foreign-Key-reference manually. And? Nothing happened. Nothing bad happened. Everything works, as it did without the foreign-key-reference...



ALTER TABLE [dbo].[AbpUsers] WITH CHECK ADD CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId] FOREIGN KEY([TenantId])
REFERENCES [dbo].[AbpTenants] ([Id])
GO

ALTER TABLE [dbo].[AbpUsers] CHECK CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId]
GO


As expected my whole application works fine, even when the initial content builder is running.










share|improve this question
























  • Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

    – aaron
    Mar 28 at 14:35











  • @aaron: Thanks. Even if I was hoping to get another answer... :-)

    – normand.bellemare
    Mar 28 at 15:42











  • Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

    – GGleGrand
    Apr 9 at 14:29












  • my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

    – normand.bellemare
    Apr 11 at 6:12













1












1








1








I was querying against SQL Server to get all columns, that are referenced to other columns. By accident I saw, that the column "tenantId" (table "AbpUsers") is not referenced to AbpTenants.Id.



I asked some of my collegues, that are "used" to know aspnetboilerplate, just to clarify. Everyone was surprised, as I am.



Just for testing purposes I created a new database by "Update-database". Before running the application, I added the "missing" foreign-Key-reference manually. And? Nothing happened. Nothing bad happened. Everything works, as it did without the foreign-key-reference...



ALTER TABLE [dbo].[AbpUsers] WITH CHECK ADD CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId] FOREIGN KEY([TenantId])
REFERENCES [dbo].[AbpTenants] ([Id])
GO

ALTER TABLE [dbo].[AbpUsers] CHECK CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId]
GO


As expected my whole application works fine, even when the initial content builder is running.










share|improve this question














I was querying against SQL Server to get all columns, that are referenced to other columns. By accident I saw, that the column "tenantId" (table "AbpUsers") is not referenced to AbpTenants.Id.



I asked some of my collegues, that are "used" to know aspnetboilerplate, just to clarify. Everyone was surprised, as I am.



Just for testing purposes I created a new database by "Update-database". Before running the application, I added the "missing" foreign-Key-reference manually. And? Nothing happened. Nothing bad happened. Everything works, as it did without the foreign-key-reference...



ALTER TABLE [dbo].[AbpUsers] WITH CHECK ADD CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId] FOREIGN KEY([TenantId])
REFERENCES [dbo].[AbpTenants] ([Id])
GO

ALTER TABLE [dbo].[AbpUsers] CHECK CONSTRAINT [FK_AbpUsers_AbpTenants_TenantId]
GO


As expected my whole application works fine, even when the initial content builder is running.







aspnetboilerplate






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 14:14









normand.bellemarenormand.bellemare

62 bronze badges




62 bronze badges















  • Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

    – aaron
    Mar 28 at 14:35











  • @aaron: Thanks. Even if I was hoping to get another answer... :-)

    – normand.bellemare
    Mar 28 at 15:42











  • Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

    – GGleGrand
    Apr 9 at 14:29












  • my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

    – normand.bellemare
    Apr 11 at 6:12

















  • Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

    – aaron
    Mar 28 at 14:35











  • @aaron: Thanks. Even if I was hoping to get another answer... :-)

    – normand.bellemare
    Mar 28 at 15:42











  • Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

    – GGleGrand
    Apr 9 at 14:29












  • my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

    – normand.bellemare
    Apr 11 at 6:12
















Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

– aaron
Mar 28 at 14:35





Answered in aspnetboilerplate/module-zero-forsaken#409 (comment).

– aaron
Mar 28 at 14:35













@aaron: Thanks. Even if I was hoping to get another answer... :-)

– normand.bellemare
Mar 28 at 15:42





@aaron: Thanks. Even if I was hoping to get another answer... :-)

– normand.bellemare
Mar 28 at 15:42













Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

– GGleGrand
Apr 9 at 14:29






Answer #409 above doesn't make a whole lot of sense to me either: if it is a foreign key, then this important table relationship should be marked as such in the DB to enable the DB and tools to work effectively outside of the app/framework itself.

– GGleGrand
Apr 9 at 14:29














my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

– normand.bellemare
Apr 11 at 6:12





my opinion. For the sake of completeness: my colleague had posted pretty much this argument also in this #409: the answer came quite soon and is at least useful ...

– normand.bellemare
Apr 11 at 6:12












1 Answer
1






active

oldest

votes


















0
















Keys exist mainly to protect referential integrity of the database. If you have no Cascade Update or Cascade Delete options on, then maybe this key was removed to make deleting things easier for someone who did not know what they were doing.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399780%2fis-there-a-reason-not-to-make-abpusers-tenantid-a-foreignkey%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0
















    Keys exist mainly to protect referential integrity of the database. If you have no Cascade Update or Cascade Delete options on, then maybe this key was removed to make deleting things easier for someone who did not know what they were doing.






    share|improve this answer





























      0
















      Keys exist mainly to protect referential integrity of the database. If you have no Cascade Update or Cascade Delete options on, then maybe this key was removed to make deleting things easier for someone who did not know what they were doing.






      share|improve this answer



























        0














        0










        0









        Keys exist mainly to protect referential integrity of the database. If you have no Cascade Update or Cascade Delete options on, then maybe this key was removed to make deleting things easier for someone who did not know what they were doing.






        share|improve this answer













        Keys exist mainly to protect referential integrity of the database. If you have no Cascade Update or Cascade Delete options on, then maybe this key was removed to make deleting things easier for someone who did not know what they were doing.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 14:30









        Kevin VandyKevin Vandy

        1796 bronze badges




        1796 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399780%2fis-there-a-reason-not-to-make-abpusers-tenantid-a-foreignkey%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현