What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hey everyone! I have deadly noob question…. 😞 I’m trying to make proper migration, but

U024KAW9FCN
U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

Hey everyone!
I have deadly noob question…. 😞
I’m trying to make proper migration, but getting

Unable to get sequence id.

when I’m trying to make any operations with the DB.

Here is the Schema:

<?xml version="1.0"?>
<database xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" name="zed" xsi:noNamespaceSchemaLocation="<http://static.spryker.com/schema-01.xsd>" namespace="Orm\Zed\HelloSpryker\Persistence" package="src.Orm.Zed.HelloSpryker.Persistence">

    <table name="pyz_hello_spryker_vol_2">
        <column name="id_hello_spryker" required="true" type="INTEGER" autoIncrement="true" primaryKey="true"/>
        <column name="reversed_string" required="true" type="VARCHAR" size="128"/>

        <id-method-parameter value="pyz_hello_spryker_vol_2_pk_seq"/>
    </table>

</database>

Thanks for any advice.

Comments

  • i assume you are using the current default postgres?

  • the only difference to an example i have here that i can spontaneously see is the idMethod

    <table name="pyz_hello_spryker" idMethod="native">
    
  • can you please try that?

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    Yes. It's default docker-based setup on Mac

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    @UJN2JRU4F Tried it, but now I'm getting error during propel:install. Smth like "can't create index pyz_......". Aborted. I can copy exact error message in an hour if it would help

  • might be worth checking

  • almost sounds like it is already present

  • possible for you to start over?

  • let’s have a look at the full error first

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    Tried to start from the very beginning, but the result is the same

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    @UJN2JRU4F
    Ok. Created new schema

    <?xml version="1.0"?>
    <database xmlns="spryker:schema-01"
              xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>"
              xsi:schemaLocation="spryker:schema-01 <https://static.spryker.com/schema-01.xsd>"
              name="zed" namespace="Orm\Zed\HelloSpryker\Persistence"
              package="src.Orm.Zed.HelloSpryker.Persistence">
    
        <table name="pyz_hello_spryker_new" idMethod="native">
            <column name="id_hello_spryker" required="true" type="INTEGER" autoIncrement="true" primaryKey="true"/>
            <column name="reversed_string" required="true" size="128" type="VARCHAR"/>
    
            <id-method-parameter value="pyz_hello_spryker_new_pk_seq"/>
        </table>
    
    </database>
    

    Migration - success.
    Still getting the same error.

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    Ah, and tried to execute SELECT nextval('pyz_hello_spryker_new_pk_seq') directly at PgSQL and it works…Returns 1 as a result

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    Another fact - switched to MySQL instead of Postgres.
    docker/sdk up and…..
    Voila! 🙂 Everything remains the same….

    Dang…Panic mode - ON!….

  • Need to have a deeper look tomorrow, sorry. What's your timezone?

  • U024KAW9FCN
    U024KAW9FCN Posts: 9 🧑🏻‍🚀 - Cadet

    Emmm……And now the most interesting part! 🙂
    After switching to MySQL (then bootstrapping app again)
    After getting back to Postgres (then bootstrapping app again)
    After 3 errors and docker restart - it eventually worked!!!!

    So THANK YOU SO MUCH for your time @UJN2JRU4F!!
    But for now it looks like question dismissed…
    So have a great evening (rest of the day)!
    P.S. In case - my TZ is GMT+2 . Since I’m learning Spryker now - you’ll see lots of questions from me 🙂 Soooorrryyy ….

  • You're welcome! Questions are very welcome!