stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.62k stars 224 forks source link

Support more advanced schemas, including foreign keys #131

Open awreece opened 7 years ago

awreece commented 7 years ago

Is this project dead? I see no updates in a few years and all the pull requests are stale. Should I bother fixing the tests in my PR and trying to integrate it?

Summary

I'm starting to use mosql to migrate from mongodb with mongoose schemas to postgres. This diff has a number of improvements that were necessary for my migration:

Examples

This corresponds to the following:

var ChildrenSchema = new mongoose.Schema({
    name: { type: String }
});

var TestSchema = new mongoose.Schema({
    name: { type: String },
    tags: [{ type: String }],
    balance: { type: Number },
    meta: { type: Object },
    children: [ ChildrenSchema ]
});
alphaflow:
    test:
        :columns:
        - id:
          :source: _id
          :type: bytea 
          :notnull: true
        - name:
          :source: name
          :type: text
        - tags:
          :source: tags
          :type: text array
        - balance:
          :source: balance
          :type: int
        - meta:
          :source: meta
          :type: jsonb
        :meta:
          :table: test 
          :schema: alphaflow
        :children:
          :meta:
            :table: test_children
            :schema: alphaflow
          :columns:
          - id:
            :source: _id
            :type: bytea not null
          - name:
            :source: name
            :type: text

Testing done

A bunch of manual testing, including on some rather complex schemas.

Note this diff is not safe to integrate, as it broke most of the unit tests

nelhage-stripe commented 7 years ago

Hey @awreece,

Unfortunately, Stripe hasn't used this project in some time and so it's been mostly unmaintained. If you happen to be interested in taking on ownership+maintenance, we'd potentially be willing to chat about that, but otherwise we probably won't be able to review this PR.

awreece commented 7 years ago

Thanks for the quick reply!

Good to know. We're not the right long term maintainers of this tool -- we view it as a way to migrate off of mongodb and so we'd abandon maintenance shortly as well.

Feel free to close the PR, but I'm also happy to just leave it open and visible in the main project -- maybe some future company will see it and want to pick up where we leave off.

CLAassistant commented 4 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

:x: awreece
:x: joshbeam
You have signed the CLA already but the status is still pending? Let us recheck it.