Cakephp bake error after schema change - cakephp

I am trying to regenerate all scaffolding after a DB schema change, and getting exception SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db01.address_types' doesn't exist in [/.../vendor/cakephp/cakephp/src/Database/Schema/Collection.php, line 130]
address_types WAS previously a table, but has been changed to enum named address_type, so table is gone and it is even getting the pluralisation wrong! Where is cake/bake getting the old schema from ?

For future reference, the problem was that I had 'backed up' some old tables with a 'z.' prefix, to keep them (just in case), somehow these were still referenced, so once I removed them, those references were gone. Oops :)

Related

EF Core Code First Automatic Column Not Deletable

I have a Code-First .Net Core project using Entity Framework Core (2.0).
There are two tables, RhythmBlock and RhythmPattern.
Based on a List<RhythmBlock> property on RhythmPattern, EF created a column on RhythmBlock of RhythmPatternId, which I didn't really want.
So I tried all the following:
Mark the List<RhythmBlock> with the Annotation [NotMapped] and update db.
User FluentAPI to tell the db to Ignore and update db.
Delete the List<RhythmBlock> and replace with a method that returns the same, updated db.
All sorts of shenanigans with resetting the Migrations, direct sql, etc.
The results of all my attempts were that anytime I deleted the column RhythmPatternId in table RhythmBlocks, I would get the error Invalid Column Name. Even if the column and all indexes and foreign keys were deleted, all reference removed from the project, the error would continue.
The only way to get my project running again? Add back in the deleted column. So it's working, but I don't understand why?

How do I automatically populate a new table in MS-Access with info from an existing table?

I am very new to MS Access and I am struggling with some things that seem like they should be the most basic. I have imported a table of data from Excel and have defined the data types for the fields. I have no problem there, but now I want to make a new table that has as a primary key one of the fields from the imported table. It looks like I can manually create this table, set the relationship, and then go back and type in each record associated with the new primary key, but this seems completely ridiculous. Surely there must be a way to automatically create one record for each unique instance in the matching field from the original table. Yet, I've scrolled through hundreds of pages of Access tutorials and Googled the question and found no satisfactory guidance.
Do I completely misunderstand what Access is all about? How do I create a new table with entries from a field on an existing table? What am I missing?
You don't specify which version of Access you are using, the suggestions listed below apply to 2010, but should be similar is other versions.
You can create new tables from existing tables using either a 'Make Table' option after selecting 'Create' -> 'Query Design', or you can manually create your table first, then use an 'Append' query.
Without knowing the design of your table it's hard to get more descriptive.
Are you populating your new table's primary key ahead of time, or relying on Auto Number to do it (preferred method)?

Cakephph 3.0 - Exception: SQLSTATE[42S02]: Base table or view not found

m using cakephp 3.0 and m using bin/cake bake all for baking all views. but m getting error while baking dependent view..like previously i had baked views for products using
bin/cake bake all products
but when i use same for
bin/cake bake all products_mix
m getting following error
Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table
'cakephp3_s.products_mix' doesn't exist in
[/home/shital/public_html/cakephp3/myCakeApp/vendor/cakephp/cakephp/src/Database/Schema/Collection.php,
line 130] 2015-02-20 06:35:57 Error: [Cake\Database\Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table
'cakephp3_s.products_mix' doesn't exist
can anyone please help me for this error.. m not getting actually what mistake m making here???
When you use cakePHP follow naming conventions or it will simply wont work.
bin/cake bake all products_mix is wrong table name . As you must use plural name for view . Remember in cakephp all names are Plurals exept your model.
I suggest you to use another grammatical proper name for view. Like say product_tags , product_attributes . See if there are multiple words for view , then make last word plural .
In other case if you have HABTM(Has And Belongs To Many) relationship, you should make both words plural. Like users_courses , here it connects to users,courses tables ,and contain Foreign key to those tables. So by naming convention HABTM table has both words pluralized.
Fore conventions in cakePHP ,refer Link.
As per CakePHP's conventions all table names should be plural not singular , so that's the first thing you should fix. products_mix in not a proper one.

postgresql and django - No unique identifier for this row

Two entries on my Django postgresql database are causing me a world of trouble when I go a-querying to create reports. When I try to delete these entries (via phpPgAdmin), I get the error "No unique identifier for this row." There are no duplicate IDs. I've tried updating all the fields. I've tried getting rid of these using the delete button and manual SQL commands. I'm out of ideas. Anyone know hot to give a row a unique identifier so I can get rid of it?
Thanks!
Look up the row by the special ctid system column and then delete by that value. ctid's are unique.
The rows you are going to delete may be referenced in another table.
remove them or refer them to something else and, then try to remove your given rows.

OLAP Error while Processing

I am new to OLAP, and figured out how to make a cube and process it. However, when i play with it too much, i eventually come up against this error:
Errors in the OLAP storage engine: The
attribute key cannot be found: Table:
dbo_v_MYEntities, Column: uniqueId,
Value: 2548. Errors in the OLAP
storage engine: The record was skipped
because the attribute key was not
found. Attribute: Unique Id of
Dimension: v MY Entities from
Database: Test Cube New, Cube: MYdm
MyApp - Views, Measure Group: v MY
Entities, Partition: v MY Entities,
Record: 2526.
It seems that some values get stuck, and the cube expect the value to be there, I know i can edit error properties and stop it from throwing exceptions, but i would like to be able to fix it.
I wouldn't mind clearing the cube, so that it re-generates itself from scratch, but i can't seem to be able to do that.
Once i get this error, even if i delete the cube, and create it again from scratch, the error is still there.
The only solution so far (in my test environment) was to change database name in project deployment target properties. Obviously this will not do the trick in production.
Basically,
Table: dbo_v_MYEntities, Column:
uniqueId, Value: 2548
Means that your table/view "dbo.v_MYEntities" has a column "uniqueid", which contains a value "2548" which is not in a table which is related to dbo.v_MYEntities in the dimension usage tab in BIDS. This usually happens when dbo.v_MYEntities is a fact table, and the related dimension table does not contain a key. I would check the referential integrity of the schema trying to determine why this is happening and correct it in the ETL or in the view definition.

Resources