similar to: Typecast values on change_column for postgresql

Displaying 20 results from an estimated 2000 matches similar to: "Typecast values on change_column for postgresql"

2007 Mar 28
1
Migration w/change_column fails on MySQL 5.1
All, I have a migration with statements like this: change_column :quote_input_class_codes, :employee_payroll, :integer, :default => 0, :null => false When I migrate, I get: (in C:/eclipse/workspace/OnlineRating) == DefaultQiccPayrollsToZero: migrating ======================================= -- change_column(:quote_input_class_codes, :employee_payroll, :integer, {:null=>false,
2006 Jul 01
1
Changing column to NOT NULL with migration silently failing.
Hi I''ve created a migration called make_customer_type_id_not_null_for_customers. The migration .rb file looks like this: class MakeCustomerTypeIdNotNullForCustomers < ActiveRecord::Migration def self.up change_column(:customers, :customer_type_id, :integer, { :null => false }) end def self.down change_column(:customers, :customer_type_id, :integer, { :null =>
2008 Jan 19
1
Decimals are being converted to Bigdecimals!!!!!
Hi all, I''m working on a financial app, and have set up some columns in my tables as decimals with precision => 8 and scale => 2. My migration looks like: change_column :lineitems, :price, :decimal, :precision => 8, :scale => 2 change_column :payments, :amount, :decimal, :precision => 8, :scale => 2 I''ve run the migration and restarted the server. I
2006 Apr 30
4
Migration, BigInts, and string lengths
Howdy Y''all, I was thrilled to recently discover migrations, as that framework addresses a common problem in an elegant way. I have, however, gotten tripped up a bit as I''ve worked with them. The first problem I encountered was that, though I was using a BigInt data type in a field in my dev database, my unit tests were failing because when I copied the schema from the dev
2006 Oct 31
4
Auto-increment lost during migration.
Hi. I get some strange results when using rename_column on a primary key in a migration. It seems like the migration script removes the auto-increment property if you rename a column. This is a minimal example. create_table :foo, :primary_key => :foo_id do |t| t.column "name", :string end # renaming the primary key makes auto-increment disappear. rename_column
2010 Apr 03
2
Specifying a decimal field precision/scale with scaffold requires 2 steps?
Hi, It appears to me that the command: ruby script/generate scaffold whatever money_field:decimal(10,2) will not generate a valid migration. Therefore it appears to me only two ways to achieve the desired result is: 1.1 Omit the the precision/scale on the scaffold command 1.2 Edit the migration file by following the "do |t| ... end" with the command: change_column :whatever
2006 Nov 13
1
Removing column default with a migration
Hi guys, I''m having problems removing the default from a boolean field. I''m using the following statement: change_column :valuations, :too_many_adults, :integer, :null => true but it''s adding DEFAULT ''0'' to the SQL statement. I''m having no luck using change_column_default either. Is this possible? Gareth
2011 Sep 12
0
Migrate column from text to binary (PostgreSQL)
Hello, So I''ve realized one of the columns in a table has to be binary instead of text. However, a straightforward change_column :my_table, :my_column, :binary fails under PostgreSQL (9.x series) The error message being: PGError: ERROR: column "my_column" cannot be cast to type bytea : ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE bytea Now
2013 Jan 20
20
ActiveRecord::Persistence.increment! requires a row lock to ensure isolated updates
The method is here: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/persistence.rb#L288. The method takes the in-memory attribute value and increments it by the specified amount. A safer approach (from an isolation standpoint) would be to let the database determine the value. Instead of telling the database what value to persist in the database, the SQL can written
2009 Jul 24
2
[PATCH server] add collapsable sections to vm form
the vm form is getting cluttered, this patch simply add collapsable sections to the form, making the 'storage' and 'network' sections collapsed by default credit goes to jayg for contributing alot to this patch in terms of simplification and cleanup --- src/app/helpers/application_helper.rb | 4 +- src/app/views/vm/_form.rhtml | 35 ++++++++++++++++++++++----------
2013 Apr 09
1
[LLVMdev] inefficient code generation for 128-bit->256-bit typecast intrinsics
Hello, LLVM generates two additional instructions for 128->256 bit typecasts (e.g. _mm256_castsi128_si256()) to clear out the upper 128 bits of YMM register corresponding to source XMM register. vxorps xmm2,xmm2,xmm2 vinsertf128 ymm0,ymm2,xmm0,0x0 Most of the industry-standard C/C++ compilers (GCC, Intel's compiler, Visual Studio compiler) don't generate any extra moves
2015 Jul 06
0
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
On Sun, 5 Jul 2015 14:59:54 +0200 "Michael S. Tsirkin" <mst at redhat.com> wrote: > On Sun, Jul 05, 2015 at 12:58:53PM +0200, Michael S. Tsirkin wrote: > > On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > > too. Here we can not assume that sizeof(pointer) is the same
2015 May 06
0
[PATCH] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). This fixes a compiler warning when compiling QEMU with the mingw32 cross-compiler. Signed-off-by: Thomas Huth <thuth at
2015 Jul 05
0
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > The virtio_ring.h header is used in userspace programs (ie. QEMU), > too. Here we can not assume that sizeof(pointer) is the same as > sizeof(long), e.g. when compiling for Windows, so the typecast in > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > Signed-off-by: Thomas Huth <thuth
2015 May 06
0
[PATCH] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). This fixes a compiler warning when compiling QEMU with the mingw32 cross-compiler. Signed-off-by: Thomas Huth <thuth at
2013 May 23
2
Backup Samba4
Dear, Can anyone help me? I'm having trouble backing up the Samba4. When I run the command /usr/sbin/samba_backup, it brings the following error: Error while archiving /usr/local/backups/samba4_private.210513.tar.bz2 Thanks, Rodrigo
2011 Mar 24
1
Workaround for CVE-2010-3933
Hi, First look this vulnerability issue: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3933 My application models: http://pastie.org/1709174 On my departments form, when user selects a health unit, I copy all health unit attributes including address and street. The parameters hash looks like this: http://pastie.org/1709217 But this was considered a vunerability issue, the
2015 Jul 06
1
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
On Mon, Jul 06, 2015 at 11:24:42AM +0200, Thomas Huth wrote: > On Sun, 5 Jul 2015 14:59:54 +0200 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > On Sun, Jul 05, 2015 at 12:58:53PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > > > > The virtio_ring.h header is used in userspace
2015 Jul 06
1
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
On Mon, Jul 06, 2015 at 11:24:42AM +0200, Thomas Huth wrote: > On Sun, 5 Jul 2015 14:59:54 +0200 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > On Sun, Jul 05, 2015 at 12:58:53PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > > > > The virtio_ring.h header is used in userspace
2015 Jul 02
2
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). Signed-off-by: Thomas Huth <thuth at redhat.com> --- include/uapi/linux/virtio_ring.h | 2 +- 1 file changed, 1