datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 39 forks source link

syncDef missing [nullable] & comment properties #415

Open Alvalunasan opened 2 years ago

Alvalunasan commented 2 years ago

Bug Report

Description

function syncDef misses [nullable] flag and field comments for foreign keys fields.

Reproducibility

Include:

  1. Create a table with a foreign key with nullable fields and comments on these fields.
    %{
    # Defined optogenetic protocols for training
    optogenetic_protocol_id   : int AUTO_INCREMENT      # 
    ---
    protocol_description    : varchar(256)         # String that describes stimulation protocol
    -> [nullable] optogenetics.OptogeneticStimulationParameter # Stimulation parameters associated with this stim protocol
    -> [nullable] optogenetics.OptogeneticWaveform
    %}
  2. run syncDef over this table.

Expected Behavior

Expected to have [nullable] foreign keys imported correctly. Expected to have imported field comments

Screenshots

Results after syncDef:

%{
# Defined optogenetic protocols for training
optogenetic_protocol_id   : int AUTO_INCREMENT      # 
---
protocol_description    : varchar(256)         # string that describes stimulation protocol
-> optogenetics.OptogeneticStimulationParameter
-> optogenetics.OptogeneticWaveform
%}

"Real" table in DB

Screen Shot 2022-06-24 at 10 26 42 AM
kabilar commented 2 years ago

Thanks @Alvalunasan. We are reviewing now.

guzman-raphael commented 2 years ago

Related to #305