Giter Site home page Giter Site logo

Comments (6)

pweilerERG avatar pweilerERG commented on July 18, 2024 1

So internal id 3 gets deleted, leaving the sequences as 1,2,4? Probably more a question for the openLCA guys. I don't think they're used as a reference at all - don't know how it would cause problems. Those feel like famous last words though.

I seem to recall that this sort of thing could cause a validation error when you validate a database. @pweilerERG do you recall if that's the case?

Yes - non-consecutive internalids will cause validation errors in the database. This should work to reset them -

from java.util import Date
dao = ProcessDao(db)
for d in dao.getDescriptors():
p = dao.getForId(d.id)
p.lastInternalId = 0
for e in p.exchanges:
e.internalId = p.lastInternalId + 1
p.lastInternalId += 1
v = Version(p.version)
v.incUpdate()
p.version = v.getValue()
p.lastChange = Date().getTime()
dao.update(p)

from electricitylci.

dt-woods avatar dt-woods commented on July 18, 2024

@m-jamieson, from what I can tell, you don't need the two JOIN statements in the second query, right? They were added in the first query just for the return table from the SELECT statement.
NM. I see that flow table holds the required "flow_type" property used for the comparison.

from electricitylci.

dt-woods avatar dt-woods commented on July 18, 2024

I know internal IDs on exchanges are just a clerical thing, but do we know if there any concern if the exchange list IDs are non-consecutive? Cause this is gonna punch a lot of holes.

from electricitylci.

m-jamieson avatar m-jamieson commented on July 18, 2024

@m-jamieson, from what I can tell, you don't need the two JOIN statements in the second query, right? They were added in the first query just for the return table from the SELECT statement.

Yes, you're right.

from electricitylci.

m-jamieson avatar m-jamieson commented on July 18, 2024

I know internal IDs on exchanges are just a clerical thing, but do we know if there any concern if the exchange list IDs are non-consecutive? Cause this is gonna punch a lot of holes.

You're talking about within an existing database? So internal id 3 gets deleted, leaving the sequences as 1,2,4? Probably more a question for the openLCA guys. I don't think they're used as a reference at all - don't know how it would cause problems. Those feel like famous last words though.

from electricitylci.

bl-young avatar bl-young commented on July 18, 2024

So internal id 3 gets deleted, leaving the sequences as 1,2,4? Probably more a question for the openLCA guys. I don't think they're used as a reference at all - don't know how it would cause problems. Those feel like famous last words though.

I seem to recall that this sort of thing could cause a validation error when you validate a database. @pweilerERG do you recall if that's the case?

from electricitylci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.