Code Monkey home page Code Monkey logo

Comments (9)

tonyc avatar tonyc commented on July 29, 2024

Hi Max,

Any thought on what the proper behavior should be?

Our usecase was that we were always manually creating the sequences and PK
fields for tables, not relying on a column actually listed as PRIMARY KEY
(don't ask :)).

I'm wondering if there's any way we can tell whether a sequence is a PK
sequence, and if so, skip it so we don't conflict with create_table. I
haven't looked at the code in a while, but I think we just query for all
sequences.

On Sat, Sep 15, 2012 at 6:58 PM, Maximilian Gaß [email protected]:

When using pg_sequencer, the primary key sequences are also added to
schema.rb, but they are automatically created as part of create_table.
Running rake:db:setup fails because Rails tries to create sequences
foo_id_seq that already exist.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1.

from pg_sequencer.

mxey avatar mxey commented on July 29, 2024

Can you give me your schema.rb as an example? I would like to compare it to mine to see how your tables look in that definition.

from pg_sequencer.

tonyc avatar tonyc commented on July 29, 2024

Now that I think of it, we never actually used the schema dumper feature.
We ended up using SQL schema dumps, so the ruby version of schema.rb is
essentially untested, like a boss :)

Would it be easy for you to pastebin a sample schema.rb? I'm not actively
involved with the project that used pg_sequencer anymore, but maybe this is
a good excuse to get back involved.

On Sat, Sep 29, 2012 at 4:50 PM, Maximilian Gaß [email protected]:

Can you give me your schema.rb as an example? I would like to compare it
to mine to see how your tables look in that definition.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-9008635.

from pg_sequencer.

mxey avatar mxey commented on July 29, 2024

I gisted both the dumped schema.rb and the one where I stripped out duplicate sequences: https://gist.github.com/3829365

from pg_sequencer.

tonyc avatar tonyc commented on July 29, 2024

OK. So it does boil down to not simply writing out all of the sequences to
schema.rb. Assume that sequences will be generated for calls to
create_table, which means filtering out sequences that belong to the PK of
a table.

Does that sound right?

On Wed, Oct 3, 2012 at 2:46 PM, Maximilian Gaß [email protected]:

I gisted both the dumped schema.rb and the one where I stripped out
duplicate sequences: https://gist.github.com/3829365


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-9119524.

from pg_sequencer.

mxey avatar mxey commented on July 29, 2024

On 03.10.2012, at 22:54, Tony Collen [email protected] wrote:

OK. So it does boil down to not simply writing out all of the sequences to
schema.rb. Assume that sequences will be generated for calls to
create_table, which means filtering out sequences that belong to the PK of
a table.

Does that sound right?

Yes.

from pg_sequencer.

achempion avatar achempion commented on July 29, 2024

I wrote a quick fix to solve problem. Read rails section for explanation - https://github.com/achempion/pg_sequencer

from pg_sequencer.

benlinton avatar benlinton commented on July 29, 2024

Here's a robust solution: #11

This approach dumps all sequences to the schema.rb unless they're owned by any table's primary key.

from pg_sequencer.

amoravec avatar amoravec commented on July 29, 2024

Thank you for your feedback, unfortunately this project was effectively abandoned and will no longer be maintained by Code42.

from pg_sequencer.

Related Issues (3)

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.