Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8875 Lượt xem

Hi,

I created a new module that add a new field "user_last_change_state" to the object "account.invouce", and I've done some code with this field.

I needed that older records to have this field equal to 1 (admin id ).

Someone knows how to set the new data field with a default value to existent records?

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

The simplest form is to do it from a sql script in postgresql. If you have linux, you could do it using pgadmin3 software. The script will be like this: UPDATE [file] SET [field] = 'value' WHERE [condition] ;

Ảnh đại diện
Huỷ bỏ
Tác giả

I did that... but it this the best way ?

I my experience yes.... but maybe there's something better.

Tác giả

Hope that someone knows a better way =)

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 22
3986
1
thg 8 19
3915
1
thg 12 21
6388
0
thg 10 21
2970
1
thg 10 21
3766