FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

renamed foreign key table definition constraint issue · Issue #518 · datajoint/datajoint-python · GitHub

Repository navigation

renamed foreign key table definition constraint issue #518

Closed

Description

defining a renamed foreign key reference to a partial key defined in:

class Animal(dj.Manual):
    definition = """
    animal_id : char(16)
    datasource_id=0: int
    ---
    animal_species: varchar(16)
    animal_name: varchar(128)
    animal_sex: ENUM('M', 'F', 'U')
    animal_dob=NULL: date
    -> AnimalColor
    """

via:

@schema
class Dam(dj.Manual):
    definition = """
    -> Animal
    (dam_id) -> Animal(animal_id)
    """

yields:

CREATE TABLE IF NOT EXISTS `tutorial_mlims_prod_ephys`.`dam` ( `animal_id` char(16) NOT NULL COMMENT "", `datasource_id` int NOT NULL COMMENT "", `dam_id` int NOT NULL COMMENT "", PRIMARY KEY (`animal_id`,`datasource_id`,`dam_id`), FOREIGN KEY (`animal_id`,`datasource_id`) REFERENCES `tutorial_mlims_prod_ephys`.`animal` (`animal_id`,`datasource_id`) ON UPDATE CASCADE ON DELETE RESTRICT, FOREIGN KEY (`datasource_id`,`dam_id`) REFERENCES `tutorial_mlims_prod_ephys`.`animal` (`animal_id`,`datasource_id`) ON UPDATE CASCADE ON DELETE RESTRICT ) ENGINE=InnoDB, COMMENT "";

and therefore this:

#517 code resolves issue.

Activity

  1. ixcat commented on Nov 14, 2018

    Author

    @dimitri-yatsenko - FYI filed this on @eywalker request for documentation; as mentioned #517 code seems to fix currently.

  2. dimitri-yatsenko commented on Nov 14, 2018

    Member

    This is a duplicate of #516. Closing.

  3. eywalker commented on Nov 14, 2018

    Contributor

    Do not close when the reported error is being different. As already noted by @ixcat the underlying issue is known to be the same as in #516. Let this be closed by accepting the PR.

  4. added a commit that references this issue on Nov 17, 2018
  5. dimitri-yatsenko commented on Nov 17, 2018

    Member

    Closing via #517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIndicates similar issues, pull requests, or discussions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL