<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:39:09 JST 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[INSTRM-1762] current agc_exposure table does not match defined constraints.</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1762</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;I&apos;ve bumped into this a few time running alembic on the current summit opdb.&lt;br/&gt;
So basically, models.py declare there is a contraint between pfs_visit.pfs_visit_id and agc_exposure_visit_id.&lt;/p&gt;

&lt;p&gt;So, that you cannot insert on a pfs_visit_id that does not exist.&lt;br/&gt;
This is the right thing to do but, but right now, on the current instance, there is no constraint, so agc_visit.pfs_visit_id can take whatever value, erk...&lt;/p&gt;

&lt;p&gt;I cannot easily add the contraint because there is pfs_visit_id in agc_exposure which does not exist in pfs_visit table :&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;set(agc[:,1]) - set(pfs[:,0])
   {0, 99999, 779594}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From what I understand, &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=cloomis&quot; class=&quot;user-hover&quot; rel=&quot;cloomis&quot;&gt;cloomis&lt;/a&gt;, agc_exposure does not necessarily have a valid pfs_visit, so it&apos;s set to 0 in that case, which is fine and we could add that &quot;fake&quot; pfs_visit_id into pfs_visit to respect the constraint. but 99999, 779594 are valid pfs_visit_id and those will eventually exist causing troubles.&lt;/p&gt;

&lt;p&gt;Fixing the issue boils down to basically 3 things to do :&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;setting pfs_visit_id to 0 where pfs_visit_id==99999 or 779594&lt;/li&gt;
	&lt;li&gt;adding a row in pfs_visit where pfs_visit_id=0&lt;/li&gt;
	&lt;li&gt;adding the contraint between agc_exposure.pfs_visit_id and pfs_visit.pfs_visit_id&lt;/li&gt;
&lt;/ol&gt;



</description>
                <environment></environment>
        <key id="23065">INSTRM-1762</key>
            <summary>current agc_exposure table does not match defined constraints.</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="arnaud.lefur">arnaud.lefur</assignee>
                                    <reporter username="arnaud.lefur">arnaud.lefur</reporter>
                        <labels>
                            <label>EngRun</label>
                    </labels>
                <created>Tue, 18 Oct 2022 22:37:32 +0000</created>
                <updated>Fri, 2 Dec 2022 23:19:10 +0000</updated>
                            <resolved>Fri, 2 Dec 2022 23:19:10 +0000</resolved>
                                                                    <component>spt_operational_database</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                <comments>
                            <comment id="31907" author="arnaud.lefur" created="Fri, 2 Dec 2022 22:52:37 +0000"  >&lt;p&gt;We really need to fix this at some point.&lt;br/&gt;
Alembic keep screaming about it &lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InvalidForeignKey) there is no unique constraint matching given keys for referenced table &quot;agc_exposure&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|02qpjd:00r3000o</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        </customfields>
    </item>
</channel>
</rss>