Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dataSource method appears to be broken #1411

Open
cfcoder opened this issue Mar 1, 2024 Discussed in #1410 · 0 comments
Open

The dataSource method appears to be broken #1411

cfcoder opened this issue Mar 1, 2024 Discussed in #1410 · 0 comments

Comments

@cfcoder
Copy link

cfcoder commented Mar 1, 2024

Discussed in #1410

Originally posted by cfcoder March 1, 2024
In the project i'm on, we are in the midst of switching from an old database to a new database. Old is HSP and new is FPMA (for referencing below). I'm needing to create a new page based on the new database that lists the projects in the new database. The old db had projects but the table was called something else. So the projects.cfc controller simply used the following to get the list of all projects.

projects = model('Project').findAll();

The Project.cfc model config would simply set the table name using the table() function as the table was not called "projects" in the old db.

I'm now trying to use the dataSource() function to override the data source name to use the new DSN FPMA, but it's not working for my new page. I change the config contents for Project.cfc model to be:

dataSource("FPMA");

and in the new Projects.cfc controller index action, I first off call that same line above:

projects = model('Project').findAll();

But now it throws an error saying there is no projects table in the database. There is in FPMA but not in HSPTest.

I think there is an issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant